Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Flutter Android: plugins need a different NDK than the project uses

ErrorYour project is configured with Android NDK 27.0.12077973, but the following plugin(s) depend on a different Android NDK version:

Short answer

Flutter's Gradle check compares the NDK your app uses with the NDK each plugin requires. NDK releases are backward compatible, so the tool's own advice is to use the highest version listed. Put that version in ndkVersion in the app's Gradle file, then let Gradle or the SDK Manager install it.

  • Applies to Flutter 3.3x stable, Android Gradle Plugin 8.x, Android SDK Manager
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Read the plugin lines under the message. Note the highest version number, then see what the app file currently sets.

    grep -n "ndkVersion" android/app/build.gradle*
    ls "$ANDROID_HOME/ndk" 2>/dev/null || ls "$HOME/Library/Android/sdk/ndk"
  2. 2Match what you see, then jump to its fix

    1. 1Each plugin line shows a higher version than the 'configured with' versionThe app's ndkVersion is lower than a plugin'sFix
    2. 2Gradle starts to download it, fails on licences, or cannot find the folder under the SDK's ndk directoryThe NDK you named is not installed on this machineFix

What does the error look like?

  • Your project is configured with Android NDK 27.0.12077973, but the following plugin(s) depend on a different Android NDK version:
  • - some_plugin requires Android NDK 28.2.13676358
  • Fix this issue by using the highest Android NDK version (they are backward compatible).

Cause 1 of 2

The app's ndkVersion is lower than a plugin's

1Check

If ndkVersion is not set in the module, the Android Gradle plugin picks the NDK it was tested with. If it is set to flutter.ndkVersion, the value is whatever your Flutter SDK defines. Either can be lower than what a newly added or upgraded plugin needs.

grep -n "ndkVersion" android/app/build.gradle android/app/build.gradle.kts 2>/dev/null

2Fix

Set ndkVersion in the android block to the highest version from the message, exactly as the tool suggests.

// android/app/build.gradle.kts
android {
    ndkVersion = "28.2.13676358"
}

3Verify

Build again. The warning no longer appears.

flutter build apk --debug

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 2 of 2

The NDK you named is not installed on this machine

1Check

Android Studio and the SDK tools keep each NDK in its own folder under the SDK's ndk directory. The Android docs say AGP 4.2.0 or later can install the NDK on first build if the licences were accepted in advance, and the SDK Manager can install a specific version by hand.

ls "$ANDROID_HOME/ndk"

2Fix

Accept the licences, or install the version in Android Studio under Tools, SDK Manager, SDK Tools, with Show Package Details on.

yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses

3Verify

Run the build; the NDK folder now holds the version you set.

flutter build apk --debug
ls "$ANDROID_HOME/ndk"

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • After flutter upgrade or a plugin upgrade, build once and read the first warnings.
  • Pin ndkVersion in the repo so CI and every laptop build with the same NDK.
  • Keep the licences accepted on build servers.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Google Play says the app does not support 16 KB memory pages

check_elf_alignment.sh reports UNALIGNED for a library under lib/arm64-v8a

Google Play requires apps that target Android 15 or higher and ship native .so libraries to run on devices with 16 KB memory pages; from 1 February 2027 it will block updates that do not.

5 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.