Skip to content

Flutter Android build errorFlutter: “Your project requires a newer version of the Kotlin Gradle plugin”

An Android build that worked before a Flutter or plugin upgrade now fails with Your project requires a newer version of the Kotlin Gradle plugin, or with Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is …, expected version is …. Both mean the Kotlin version your Android project declares is older than what Flutter or a plugin was built with. The fix is one line, but where that line lives depends on when the project was created. Here is where, in Flutter’s words, or hand it over at a fixed price.

Short answer

Raise the Kotlin version in your Android build files. In projects made with Flutter 3.16 or later it is the org.jetbrains.kotlin.android line in android/settings.gradle (or settings.gradle.kts). In older projects it is ext.kotlin_version in android/build.gradle, which is the file Flutter’s error message names even on newer projects. To find a version that works with your Flutter release, create a new project with the same Flutter version and copy its value, then run flutter clean and build again.

Where the Kotlin version lives, and how to raise it

  1. 01

    Projects made with Flutter 3.16 or later: settings.gradle

    “For example, the Kotlin version is now configured in the android/settings.gradle file.” Flutter, Required Kotlin version

    Newer projects declare their plugins in android/settings.gradle, and the Kotlin version is on the org.jetbrains.kotlin.android line. Raise that number. Replace {kotlinVersion} and {agpVersion} below with real version numbers; don’t paste the braces. Current Flutter creates settings.gradle.kts, where the same line uses Kotlin syntax.

    plugins {
        id "dev.flutter.flutter-plugin-loader" version "1.0.0"
        id "com.android.application" version "{agpVersion}" apply false
        id "org.jetbrains.kotlin.android" version "{kotlinVersion}" apply false
    }
    
    // settings.gradle.kts
    plugins {
        id("org.jetbrains.kotlin.android") version "{kotlinVersion}" apply false
    }
  2. 02

    Older projects: ext.kotlin_version in android/build.gradle

    “If you have generated your project with an older version of Flutter, it's advisable to upgrade your build scripts to the newest form.” Flutter, Required Kotlin version

    Projects created before that keep the version in the buildscript block of android/build.gradle, as ext.kotlin_version. Raising it fixes the error, but Flutter recommends moving these files to the new declarative format, which is a one-time change worth doing before the next upgrade.

    buildscript {
        ext.kotlin_version = '{kotlinVersion}'
    }
  3. 03

    Pick the version from a fresh project, not from a forum post

    Versions that work depend on your Flutter release and your Android Gradle Plugin version. The safest source is a new project made by the same Flutter you use: run flutter create in a scratch folder and copy the Kotlin and Android Gradle Plugin versions from its android/settings.gradle. Change both together if the new project’s Android Gradle Plugin is newer too.

    flutter --version
    flutter create /tmp/kotlin_check
    grep -n "kotlin\|com.android.application" /tmp/kotlin_check/android/settings.gradle*
  4. 04

    “Incompatible version of Kotlin”: a plugin was built with a newer one

    The metadata message names two versions: the one a library was compiled with and the one your project expects. Raise your project’s Kotlin version to at least the first number, using the steps above. Then run flutter clean, flutter pub get and build again, so no stale Gradle output is reused.

Checked against the vendor’s docs on : Flutter docs: Required Kotlin version; Flutter docs: Deprecated imperative apply of Flutter’s Gradle plugins.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

Related: Flutter “Gradle task assembleDebug failed” · Flutter “Unsupported class file major version” · Google Play target API level 35 and 36 · Flutter MissingPluginException

Questions

More on this error

Do I need to write Kotlin to fix this?

No. The Kotlin version is a build setting even if your app is all Dart. Flutter and many plugins use Kotlin on Android, so the build needs a recent enough version declared.

Why did it start after I upgraded Flutter or a plugin?

The upgrade brought in code built with a newer Kotlin than your project declares. Your project files didn’t change, so the old version number is now too low.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.