Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

external_app_launcher: uses or overrides a deprecated API. #37

Open
ricardomoresqui opened this issue Apr 27, 2024 · 8 comments
Open

external_app_launcher: uses or overrides a deprecated API. #37

ricardomoresqui opened this issue Apr 27, 2024 · 8 comments

Comments

@ricardomoresqui
Copy link

Note: C:\Users\vrica\AppData\Local\Pub\Cache\hosted\pub.dev\external_app_launcher-4.0.0\android\src\main\java\com\example\launchexternalapp\LaunchexternalappPlugin.java uses or overrides a deprecated API.

Flutter 3.19.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ba39319843 (7 weeks ago) • 2024-03-07 15:22:21 -0600
Engine • revision 2e4ba9c6fb
Tools • Dart 3.3.1 • DevTools 2.31.1

Please! What I have to do?

@jahidsakan
Copy link

Same issue

@elicul
Copy link

elicul commented Jul 1, 2024

Having the same issue

@nargil07
Copy link

Same issue

@labaxter
Copy link

labaxter commented Aug 17, 2024

Same issue (on linux).
This message come out of build.
Build fails.


pub.dev/external_app_launcher-4.0.0/android/src/main/java/com/example/launchexternalapp/LaunchexternalappPlugin.java uses or overrides a deprecated API.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':external_app_launcher:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR:/home/lab/src/vui/build/external_app_launcher/intermediates/merged_res/release/values/values.xml:194: AAPT: error: resource android:attr/lStar not found.


* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Removing the reference to external_app_launcher allows build to complete.
Flutter doctor output below.

flutter doctor -v
[✓] Flutter (Channel stable, 3.24.0, on Debian GNU/Linux 12 (bookworm) 6.1.0-13-amd64, locale en_US.UTF-8)
    • Flutter version 3.24.0 on channel stable at /home/lab/devel/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 80c2e84975 (3 weeks ago), 2024-07-30 23:06:49 +0700
    • Engine revision b8800d88be
    • Dart version 3.5.0
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/lab/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /home/lab/Android/Sdk
    • Java binary at: /home/lab/devel/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Debian clang version 14.0.6
    • cmake version 3.25.1
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[✓] Android Studio (version 2024.1)
    • Android Studio at /home/lab/devel/android-studio
    • Flutter plugin version 81.0.2
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.91.1)
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Debian GNU/Linux 12 (bookworm) 6.1.0-13-amd64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 127.0.6533.88

[✓] Network resources
    • All expected network resources are available.

• No issues found!

BTW: version 3.1.0 is also broken.

@nargil07
Copy link

I think it will resolved by this PR #39

@paraflu
Copy link

paraflu commented Aug 20, 2024

Waiting for release 💕

@labaxter
Copy link

labaxter commented Sep 3, 2024

I decided I did not want to wait any longer for a new release. I can confirm that changing compileSdkVerion in android/build.gradle from

compileSdkVersion 28

to

compileSdkVersion 31

fixes the problem.

Steps I used to verify this:

  1. git clone external_app_launcher (via git URL)
  2. change android/compileSdkVerion to 31 (from 28)
  3. changed my reference to external_app_launcher to cloned project via path: in my pubspec.yaml.
  4. ran pub get in my project
  5. Tested my application. It compiled and functioned correctly.

The PR #39 should be merged, and a new release produced.

In the meantime, I'll be running off my fixed clone.

@gdurandrexel
Copy link

gdurandrexel commented Sep 5, 2024

For a "fix" to other packages with the same problem, see also flutter/flutter#153281 (comment)

TLDR; in your flutter project, in android\build.gradle, add this code before the other subprojects sections:

subprojects {
    afterEvaluate { project ->
        if (project.extensions.findByName("android") != null) {
            Integer pluginCompileSdk = project.android.compileSdk
            if (pluginCompileSdk != null && pluginCompileSdk < 31) {
              project.logger.error(
                "Warning: Overriding compileSdk version in Flutter plugin: "
                  + project.name
                  + " from "
                  + pluginCompileSdk
                  + " to 31 (to work around https://issuetracker.google.com/issues/199180389)."
                  + "\nIf there is not a new version of " + project.name + ", consider filing an issue against "
                  + project.name
                  + " to increase their compileSdk to the latest (otherwise try updating to the latest version)."
                )
                project.android {
                    compileSdk 31
                }
            }
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants