GeekyAnts / external_app_launcher

BSD 3-Clause "New" or "Revised" License
14 stars 31 forks source link

external_app_launcher: uses or overrides a deprecated API. #37

Open ricardomoresqui opened 4 months ago

ricardomoresqui commented 4 months ago

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 commented 2 months ago

Same issue

elicul commented 2 months ago

Having the same issue

nargil07 commented 3 weeks ago

Same issue

labaxter commented 2 weeks ago

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 commented 2 weeks ago

I think it will resolved by this PR https://github.com/GeekyAnts/external_app_launcher/pull/39

paraflu commented 2 weeks ago

Waiting for release 💕

labaxter commented 3 days ago

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 https://github.com/GeekyAnts/external_app_launcher/pull/39 should be merged, and a new release produced.

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

gdurandrexel commented 1 day ago

For a "fix" to other packages with the same problem, see also https://github.com/flutter/flutter/issues/153281#issuecomment-2292201697

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
                }
            }
        }
    }
}