The current Kotlin version is 1.9.22. I updated ” with ‘1.9.22’, but I’m still encountering the same error even after updating.
android>build.gradle
buildscript {
ext.kotlin_version = '1.9.22'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Error:
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 C:UserskarthDesktopkarthikandroidbuild.gradle: │
│ ext.kotlin_version = '<latest-version>' │
└────────────────────────────────────────────────────────────────────────────────────────────
2
Answers
Kotline 1.9.10
Released: August 23, 2023
For Android Studio Giraffe and Hedgehog, the Kotlin plugin 1.9.10 will be delivered with upcoming Android Studios updates.
you can check on this link:
https://kotlinlang.org/docs/releases.html#release-details
2024 Update
The reason you are getting this error message is that you have installed some extra dependencies in your pubspec.yaml file. One of those external dependencies requires a newer version of the gradle plugin to run on your version of Android.
How to fix this error in 2024.
First, go to this website and find the latest Kotlin version
https://kotlinlang.org/docs/releases.html#release-details
After that open your build.gradle file and copy this code where it is located at
E://your_project_path/android/build.gradle
After that go to the settings.gradle file in the Android folder
Now your build.gradle file and settings.gradle files are updated. But still, your error occurs because there is one mandatory step to do. Please remember in every build.gradle or settings.gradle update you should restart your project. I recommend your to close the entire project and reopen it using the VSCode or whoever you use as the IDE.
Check the same steps on YouTube
https://youtu.be/0SxMyy_b5Y0?si=tfXrv-UrTCtgjSv7
Hurray! Thanks me later! Now your problem is solved!