Flutter: Your project requires a newer version of the Kotlin Gradle plugin
Fix the Flutter error 'Your project requires a newer version of the Kotlin Gradle plugin' by updating the ext.kotlin_version in your build.gradle file to the latest Kotlin release.
[!] Your project requires a newer version of the Kotlin Gradle plugin.
Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then update
<project path>\android\build.gradle:
ext.kotlin_version = '<latest-version>'
This can be fixed in two simple steps:
- Step 1 – Go to https://kotlinlang.org/docs/releases.html#release-details and determine the latest version of Kotlin. In my case, it was 1.9.0.
- Step 2 – Open up your
build.gradlefile (located at<project path>\android\build.gradle) and right at the top (usually on the second line), you should see something likeext.kotlin_version = '1.6.10'. Update that line to point to the latest Kotlin version. In my case, it would look like this:
buildscript {
ext.kotlin_version = '1.9.0'
[...]