Flutter Android: plugins need a different NDK than the project uses
Your 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.
Fix it fast
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"2Match what you see, then jump to its fix
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.13676358Fix 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/null2Fix
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 --debugConfirmed by raw.githubusercontent.com
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 --licenses3Verify
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
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
Related fixes
Mobile apps
Android build fails: Could not get unknown property 'ndkVersion' for extension 'flutter'
Could not get unknown property 'ndkVersion' for extension 'flutter' of type FlutterExtension
The android/app/build.gradle file reads flutter.ndkVersion, but the Flutter Gradle plugin that Gradle loaded has no such property.
3 causes, each with a fixMobile 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 fixMobile apps
Gradle cannot find com.google.firebase:firebase-analytics-ktx
Required by: project :app
Firebase moved the Kotlin extensions into the main modules and stopped releasing the -ktx modules in July 2025.
2 causes, each with a fixMobile apps
Gradle cannot create LibraryVariantBuilderImpl in a Flutter Android build
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl
This error appears when the Android Gradle plugin (AGP) cannot run in the Gradle or IDE you use.
3 causes, each with a fixMobile apps
Flutter release build cannot open the keystore: HmacPBESHA256 not available
Algorithm HmacPBESHA256 not available
The keystore is a PKCS12 file protected by a newer algorithm than the Java that is reading it understands.
3 causes, each with a fixMobile apps
Android install error: the package conflicts with an existing package of the same name
The package conflicts with an existing package by the same name
Android allows only one app per application ID, and an update must be signed with the same certificate as the installed version.
3 causes, each with a fix