Flutter Android build says the project requires a newer Kotlin Gradle plugin
Your project requires a newer version of the Kotlin Gradle plugin.Short answer
Flutter's Android build needs Kotlin Gradle plugin 1.5.31 or newer. Projects from older templates set it as ext.kotlin_version in android/build.gradle. Newer templates declare it in the plugins block of android/settings.gradle. Raise the value in the file your project really uses, then rebuild.
Fix it fast
1Find out which cause you have
Find where the Kotlin version is set. Only one of the two files normally holds it.
grep -n "kotlin" android/build.gradle android/settings.gradle2Match what you see, then jump to its fix
- 1
The grep shows ext.kotlin_version = '1.3.50' (or any value below 1.5.31) inside buildscriptAn older project still sets ext.kotlin_version in android/build.gradleFix - 2
There is no ext.kotlin_version, but settings.gradle declares a Kotlin Android pluginThe version lives in the plugins block of android/settings.gradleFix
- 1
What does the error look like?
Your project requires a newer version of the Kotlin Gradle plugin.Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions
Cause 1 of 2
An older project still sets ext.kotlin_version in android/build.gradle
1Check
Flutter requires Kotlin 1.5.31 or newer for Android builds because the embedding depends on an AndroidX library that needs it.
grep -n "kotlin_version" android/build.gradle2Fix
Replace the old value with 1.5.31 or a later version. Keep one line, not both. The Flutter message asks for the latest version listed on the Kotlin site.
buildscript {
ext.kotlin_version = '1.5.31' // or newer
}3Verify
Rebuild the Android app.
flutter build apk --debugConfirmed by docs.flutter.dev
Cause 2 of 2
The version lives in the plugins block of android/settings.gradle
1Check
Since Flutter 3.16 the Kotlin version is configured in android/settings.gradle. Editing build.gradle in such a project changes nothing.
grep -n "org.jetbrains.kotlin" android/settings.gradle2Fix
Raise the version in the Kotlin plugin line of the plugins block. The Kotlin Gradle plugin and Kotlin share one version number, and the Kotlin docs list which Gradle and Android Gradle plugin versions each release supports, so pick a version that fits your Gradle and AGP.
plugins {
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
}3Verify
Rebuild; the message no longer appears.
flutter build apk --debugConfirmed by kotlinlang.org
How do I stop it coming back?
- Move an old android folder to the current template layout instead of patching it version by version.
- After upgrading Flutter, run a debug Android build before starting feature work.
- Check the Kotlin compatibility table before picking a Kotlin version for your Gradle and AGP.
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:
- 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.
- Nuclear Home VideoA video-streaming Android app built from scratch, engineered for smooth playback.
Related fixes
Mobile apps
Flutter Android build fails: module was compiled with an incompatible Kotlin version
Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.16
The compiler met a library built with a newer Kotlin than the one your project uses.
2 causes, each with a fixMobile 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
Kotlin cannot find FlutterActivity in MainActivity
Unresolved reference: FlutterEngine
Kotlin only knows FlutterActivity if the import points at the v2 class, io.flutter.embedding.android.FlutterActivity, and the Flutter embedding is on the module's classpath.
3 causes, each with a fixMobile apps
Play Console warns the bundle may be obfuscated and has no mapping file
This App Bundle contains Java/Kotlin code, which might be obfuscated.
This warning is about crash reports, not about your release being blocked.
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
Android build fails because a product flavor has no flavor dimension
The flavor 'flavor_name' is not assigned to a flavor dimension.
Android Gradle plugin refuses to build when a product flavor is not assigned to a flavor dimension.
2 causes, each with a fix