Flutter Solve Project Requires A Newer Version of the Kotlin Gradle Plugin Error

Hello friends, Recently when I was running flutter run command then I saw there are a new flutter update has come. So I thought let’s update to the latest version of Flutter using Flutter Doctor command. It take few minutes to update then we’re good to go with new flutter version 2.10.1 . Now as usual I run flutter run command, Then what I see next is a large error. The error known as “Flutter Fix Your project requires a newer version of the Kotlin Gradle plugin.” So I starting looking on Google to solve this error and soon I was able to find the best solution to solve this error. I am sharing the solution with you guys. So in this tutorial we would learn about Flutter Solve Project Requires A Newer Version of the Kotlin Gradle Plugin Error.

Error in Text format :-

D:\Flutter\app2>flutter run
Running “flutter pub get” in app2… 2,661ms
Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling
software rendering with “–enable-software-rendering”.
Launching lib\main.dart on Android SDK built for x86 in debug mode…
e: C:/Users/Home/.gradle/caches/transforms-3/208362b07d3e0bf85c7547c81d13f4a6/transformed/jetified-window-java-1.0.0-beta04-api.jar!/META-INF/window-java_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: C:/Users/Home/.gradle/caches/transforms-3/39760d7a0475ca2f45c2c74e25a33c8f/transformed/jetified-window-1.0.0-beta04-api.jar!/META-INF/window_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: C:/Users/Home/.gradle/caches/transforms-3/3daae2c58c5ac28aa4fb5d33a8b4794c/transformed/jetified-kotlin-stdlib-1.5.31.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: C:/Users/Home/.gradle/caches/transforms-3/931c208f743c860a4db31bdbbd4e70d6/transformed/jetified-kotlin-stdlib-common-1.5.31.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: C:/Users/Home/.gradle/caches/transforms-3/9c6baf5f9988aedaf0355e65cf7aa1f7/transformed/jetified-kotlin-stdlib-jdk7-1.5.30.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: C:/Users/Home/.gradle/caches/transforms-3/ad82bff72bbd8fbd61aabb97cb182001/transformed/jetified-kotlinx-coroutines-android-1.5.2.jar!/META-INF/kotlinx-coroutines-android.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: C:/Users/Home/.gradle/caches/transforms-3/b66f74c900f27a7afcee2cb103e9754c/transformed/jetified-kotlinx-coroutines-core-jvm-1.5.2.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: C:/Users/Home/.gradle/caches/transforms-3/ca5061a49450daa73e3b9ba7f07e1f2d/transformed/jetified-kotlin-stdlib-jdk8-1.5.30.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ‘:app:compileDebugKotlin’.
> Compilation error. See log for more details

* Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output. Run with –scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m
Running Gradle task ‘assembleDebug’… 63.3s

┌─ Flutter Fix ───────────────────────────────────────────────────────────────────────────────────────┐
│ [!] 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, then update │
│ D:\Flutter\app2\android\build.gradle: │
│ ext.kotlin_version = ‘<latest-version>’ │
└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1

D:\Flutter\app2>

Error Screenshot :-

Contents in this project Flutter Solve Project Requires A Newer Version of the Kotlin Gradle Plugin Error :-

1. To solve this error all we have to do is upgrade the Kotlin Gradle version in our flutter project. So open Your_Flutter_Project -> android -> build.gradle file in Text editor, I am using Visual Studio Code Editor.

2. Find ext.kotlin_version under buildscript and Here you have to upgrade the Kotlin version to latest. You can find latest Kotlin version HERE. Latest version of Kotlin is 1.6.10 .

3. Now save the file and all you have to do is execute flutter run command and your project will run again without any error.

6 Comments

  1. Thanks for this. It seems obvious now you’ve explained it but it helps those of us who are new/have been looking at the screen for too many hours!

  2. me ajudou aki tmb .. vlw

  3. Yup, worked for me as well. Thanks pal 🙂

Leave a Reply

Your email address will not be published.