BugMedic

Flutter “requires a newer version of the Kotlin Gradle plugin”: bump it

Bump ext.kotlin_version in android/build.gradle to the version Flutter requires, then rebuild.

By BugMedic editorial teamLast source review: 2026-09-29macOS, Windows, Linux

Open android/build.gradle and raise ext.kotlin_version to the version the error asks for (recent templates use 2.x). Then run flutter clean and rebuild. If the android folder is old and drifted, back it up and regenerate with flutter create --platforms=android .

Try these fixes in order

01

Open android/build.gradle

Find the ext.kotlin_version line (Groovy) or the kotlin plugin version (Kotlin DSL).

grep -n "kotlin" android/build.gradle*
02

Bump the Kotlin plugin version

Use the version from the error message. Flutter's current templates pin a recent 2.x release; this rewrites the pinned version in place.

sed -i '' "s/ext.kotlin_version *= *'[^']*'/ext.kotlin_version = '2.1.0'/" android/build.gradle
03

Clean the build

This clears cached build outputs so the new plugin version is actually used.

flutter clean
04

Rebuild

The Gradle sync should now pick the new Kotlin plugin and compile.

flutter run

Interpret what you see

The message states a minimum Kotlin version

What it suggests: The error names the required version. The project's ext.kotlin_version in android/build.gradle (or the plugins block in build.gradle.kts) is below it.

Next check: Update ext.kotlin_version to the required version and sync.

The failure started after flutter upgrade

What it suggests: Upgrading Flutter often bumps the template's Kotlin version; old projects keep the old pin.

Next check: Compare your android/build.gradle against a fresh flutter create template.

The error persists after editing the version

What it suggests: A stale Gradle cache can keep resolving the old plugin even after you bump the version.

Next check: Run flutter clean before rebuilding.

Why this happens

  • The project's android/build.gradle pins an old Kotlin Gradle plugin while the Flutter SDK or AGP expects a newer one.
  • An upgraded Flutter SDK raised the minimum Kotlin version for the android folder template.

Still not working?

Do not hand-edit generated files under android/ blindly across every upgrade; if the android folder is heavily drifted, regenerating it with flutter create --platforms=android . (after backing up) is safer than patch-chasing versions.

Official sources

These steps are based on the linked documentation and general diagnostics. BugMedic has not independently tested every product and system configuration. Review commands before running them.

Related Flutter guides