Flutter says plugins need a higher compileSdk or a different NDK
Your project is configured to compile against Android SDK 35, but the following plugin(s) requireShort answer
Flutter checks every plugin's compileSdk and NDK version before building. If a plugin compiles against a higher Android SDK than your app, it names the plugins and the exact value to put in your app's build file. If the NDK differs, it does the same for ndkVersion. A higher compileSdk also needs a new enough Android Gradle plugin.
Fix it fast
1Find out which cause you have
Read the list under the warning. Each plugin line gives the SDK or NDK version it needs; the highest one is the number to use.
flutter build apk --debug 2>&1 | grep -B2 -A8 "configured"2Match what you see, then jump to its fix
- 1
following plugin(s) require to be compiled against a higher Android SDK versioncompileSdk in the app is lower than a plugin'sFix - 2
You raised compileSdk and the project uses an AGP older than that API level needsThe Android Gradle plugin is too old for the new compileSdkFix - 3
following plugin(s) depend on a different Android NDK versionA plugin needs a different NDK versionFix
- 1
What does the error look like?
Your project is configured to compile against Android SDK 35, but the following plugin(s) requireto be compiled against a higher Android SDK version:Fix this issue by compiling against the highest Android SDK version (they are backward compatible).a different Android NDK version:
Cause 1 of 3
compileSdk in the app is lower than a plugin's
1Check
The app's compileSdk is compared with each plugin's. If the app sets none, Flutter treats it as unlimited, so this only appears when you hard-coded a number. Look at the file Flutter names.
grep -n "compileSdk" android/app/build.gradle*2Fix
Set compileSdk to the highest plugin value from the list. Plugins are backward compatible, so a higher number is safe. It only changes which Android APIs you can call; it is not targetSdk.
// android/app/build.gradle.kts
android {
compileSdk = 36
}3Verify
The warning is gone and the build continues.
flutter build apk --debugConfirmed by raw.githubusercontent.com
Cause 2 of 3
The Android Gradle plugin is too old for the new compileSdk
1Check
Android's minimum tool table: API 35 needs AGP 8.6.0, API 36 needs 8.9.1, API 36.1 needs 8.13.0 and API 37 needs 9.1.1. Check which AGP your project uses.
grep -rn "com.android.application" android/settings.gradle* android/build.gradle*2Fix
Raise the AGP version in settings.gradle(.kts) to at least the one your compileSdk needs, and use the Gradle version that AGP requires (8.13 needs Gradle 8.13, 9.0 needs 9.1.0).
// android/settings.gradle.kts
plugins {
id("com.android.application") version "8.9.1" apply false
}
# android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip3Verify
A debug build completes with the new compileSdk.
flutter build apk --debugConfirmed by developer.android.com
Cause 3 of 3
A plugin needs a different NDK version
1Check
Flutter compares your ndkVersion with each plugin's. Plugin lines read 'requires Android NDK <version>'.
grep -n "ndkVersion" android/app/build.gradle*2Fix
Use the highest NDK version from the list; Flutter states that NDK versions are backward compatible.
// android/app/build.gradle.kts
android {
ndkVersion = "28.2.13676358" // use the value printed in the warning
}3Verify
The NDK warning no longer appears.
flutter build apk --debugConfirmed by raw.githubusercontent.com
How do I stop it coming back?
- Prefer the values Flutter's template sets over copying old numbers from other projects.
- Raise compileSdk and the Android Gradle plugin in the same change, not one at a time.
- Run flutter pub outdated before an upgrade, and build once after each plugin bump.
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
Flutter Android build stops with Execution failed for task ':app:…'
Execution failed for task ':app:compileFlutterBuildRelease'.
The line only tells you which Gradle step broke; the task name in the quotes tells you why.
5 causes, each with a fixMobile apps
A library needs a higher compileSdk than your module sets
Execution failed for task ':app:checkDebugAarMetadata'.
A dependency declares a minimum compileSdk, and your module compiles against a lower one.
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 fix