Skip to content

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

Closed

Description

@bartekpacia

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.

Activity

  1. 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[/+] on May 3, 2024
  2. added
    in triagePresently being triaged by the triage team
    on May 6, 2024
  3. huycozy commented on May 6, 2024

    @huycozy
    Member

    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?

  4. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on May 6, 2024
  5. bartekpacia commented on May 6, 2024

    @bartekpacia
    MemberAuthor

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

    But for sure this test reproduces this problem.

  6. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on May 6, 2024
  7. huycozy commented on May 7, 2024

    @huycozy
    Member

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

  8. added
    platform-androidAndroid applications specifically
    toolAffects the "flutter" command-line tool. See also t: labels.
    t: gradle"flutter build" and "flutter run" on Android
    c: proposalA detailed proposal for a change to Flutter
    team-androidOwned by Android platform team
    and removed
    in triagePresently being triaged by the triage team
    on May 7, 2024
  9. added a commit that references this issue on May 7, 2024
    7cf1969
  10. added
    r: fixedIssue is closed as already fixed in a newer version
    on May 8, 2024
  11. github-actions commented on May 22, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  12. locked as resolved and limited conversation to collaborators on May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: proposalA detailed proposal for a change to Flutterplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions