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

"One or more plugins require a higher Android SDK/NDK version" – tell me what these plugins are #147806

Closed
bartekpacia opened this issue May 3, 2024 · 3 comments · Fixed by #147809
Labels
c: proposal A detailed proposal for a change to Flutter platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version t: gradle "flutter build" and "flutter run" on Android team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@bartekpacia
Copy link
Member

bartekpacia commented May 3, 2024

Steps to reproduce

This error message could've been more helpful, i.e. mention specifically which plugins require higher NDK version:

$ flutter build apk --debug

One or more plugins require a higher Android NDK version.
Fix this issue by adding the following to /Users/bartek/projects/example/android/app/build.gradle:
android {
  ndkVersion "25.1.8937393"
  ...
}

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Expected results

$ flutter build apk --debug

Your project is configured with Android NDK 23.1.7779620, but the following plugin(s) require a higher Android NDK version:
- firebase_core requires 25.1.8937393
- location requires 25.1.8937393
Fix this issue by adding the following to /Users/bartek/projects/example/android/app/build.gradle:
android {
  ndkVersion "25.1.8937393"
  ...
}

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Reproduction

I'm using Flutter from master branch (~May 3rd, 2024):

  1. flutter create --platforms=android example

  2. Add some plugins to pubspec.yaml:

    dependencies:
      firebase_core: ^2.30.1
      location: ^6.0.1
  3. flutter build apk --debug

Flutter Doctor output

Doctor output
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.22.0-23.0.pre.30, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 15.3)
    ✗ Unable to get list of installed Simulator runtimes.
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2023.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.1)
[✓] VS Code (version 1.89.0)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 2 categories.
@bartekpacia bartekpacia changed the title "One or more plugins require a higher Android NDK version" – tell me what plugins "One or more plugins require a higher Android SDK/NDK version" – tell me what these plugins are May 3, 2024
@huycozy huycozy added the in triage Presently being triaged by the triage team label May 6, 2024
@huycozy
Copy link
Member

huycozy commented May 6, 2024

Hi @bartekpacia, this change makes sense but I couldn't reproduce the issue.

In the first build, I faced incompatible version of Kotlin issue with location-6.0.1 plugin, I had to change it from 1.7.10 to 1.9.0.

...
e: /Users/huynq/.pub-cache/hosted/pub.dev/location-6.0.1/android/src/main/java/com/lyokone/location/FlutterLocationService.kt: (294, 17): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
...

Then when I built the project again, it was successful without NDK version issue. I wonder if there is any more step to reproduce this?

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 6, 2024
@bartekpacia
Copy link
Member Author

@huycozy You're right, sorry. I must've missed something.

But for sure this test reproduces this problem.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 6, 2024
@huycozy
Copy link
Member

huycozy commented May 7, 2024

Yes, it's obvious through that test. Marking this as a proposal for this improvement.

@huycozy huycozy added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. t: gradle "flutter build" and "flutter run" on Android c: proposal A detailed proposal for a change to Flutter team-android Owned by Android platform team and removed in triage Presently being triaged by the triage team labels May 7, 2024
auto-submit bot pushed a commit that referenced this issue May 7, 2024
This PR resolves #147806

- List plugin that want to be compiled against a higher Android SDK version
- List plugins that depend on a different NDK version (we don't have a way to compare them)
- Small formatting and wording improvements
- Update syntax to work for both Groovy and Kotlin
- If project uses `build.gradle.kts`, then it is mentioned in the warning message (previously always `build.gradle` was mentioned)

<img width="1209" alt="demo" src="https://github.com/flutter/flutter/assets/40357511/be3522b5-d1b4-4983-9fed-8aaa0f0bc7f7">
@huycozy huycozy added the r: fixed Issue is closed as already fixed in a newer version label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: proposal A detailed proposal for a change to Flutter platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version t: gradle "flutter build" and "flutter run" on Android team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants