Hi Guys, Welcome to Proto Coders Point. Today I encountered as issue/error message, when I build flutter project and tryed to run on my physical device.
Flutter Android Error
The error said
"your project requires a newer version of kotlin gradle plugin".
Actually the project which I was trying to run was created 4 month age. You can read the full detail of error message:
BUILD FAILED in 1m 2s Running Gradle task 'assembleDebug'... 64.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 /Users/goodman/Desktop/Projects/kindacode/android/build.gradle: ext.kotlin_version = '<latest-version>' ─────────────────────────────────────────────────────────────────── Exception: Gradle task assembleDebug failed with exit code 1
No need to panic if you encountered the same issue, because the solution is very easy to follow:
Solution – Update Flutter Kotlin version to latest
To solve “newer version of kotlin gradle plugin”, Simple you need to update kotlin version i.e ext.kotlin_version.
Project > android > build.gradle
The current latest version at the time of this article is 1.6.10, It will change in future. So to get the updated latest version of kotlin gradle plugin kindly visit official site https://kotlinlang.org/docs/gradle.html.