Your project requires a newer version of the kotlin gradle plugin Error

As a flutter developer, you may get the "your project requires a newer version of the kotlin gradle plugin" error while running your Flutter app,. This error occurs, when you have an older version of kaolin at build.gradle. 

Here Are The Error Messages

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':fluttertoast: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 45s
Running Gradle task 'assembleDebug'...                            107.9s

┌─ 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 E:\flutter_apps\geodata\android\build.gradle: │ │ ext.kotlin_version = '<latest-version>' │ └────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Exception: Gradle task assembleDebug failed with exit code 1

How to fix this error

if you are a flutter developer and have flutter version 2.10.0 and below. You may likely experience the “Your Project requires a newer version of kotlin Gradle plugin error” when you upgrade (flutter upgrade) your flutter SDK to 2.12.0  or even newer in the future.

After upgrading your flutter SDK to 2.12.0 or newer you may not experience any issues while developing your app. but Still, you will get this error message especially when you want to run your app in an Android emulator.

To fix this issue you need to upgrade your ex.kotlin_version to the current version at the following path in your flutter project              your app/Android/build.gradle   at the time of publishing this post the latest version of  ex.kotlin_version is 1.6.10


Next, you replace the current values of ex.kotlin_version to the current version


Finally Save” the file and run your project again and your flutter project will run now without “Your Project requires a newer version of kotlin Gradle plugin” errors again



No comments

Powered by Blogger.