Maaz Zindani

Loading the index…

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

Flutter Android build says the project requires a newer Kotlin Gradle plugin

ErrorYour 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.

  • Applies to Flutter 3.35, Gradle 8.x, Kotlin Gradle plugin
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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.gradle
  2. 2Match what you see, then jump to its fix

    1. 1The 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. 2There is no ext.kotlin_version, but settings.gradle declares a Kotlin Android pluginThe version lives in the plugins block of android/settings.gradleFix

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.gradle

2Fix

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 --debug

Confirmed by docs.flutter.dev

Did this fix it?

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.gradle

2Fix

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 --debug

Confirmed by kotlinlang.org

Did this fix it?

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:

Related fixes

Mobile 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 fix

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.