Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!
We spend hours on Instagram and YouTube and waste money on coffee and fast food, but wonβt spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!
Learn from Guru Rajesh Kumar and double your salary in just one year.
Error
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

Solution of This error:
The latest version we get is β1.6.21β, now you have to update the version code at build.gradle located at android\build.gradle path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
ext.kotlin_version = '1.6.21' | |
repositories { | |
google() | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:4.1.0' | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
} | |
} |
change the version no. of ext.kotlin_version.
In this way, you can solve βyour project requires a newer version of the kotlin gradle pluginβ error in Flutter.