Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to run my flutter app But I am facing following error: Your project requires a newer version of the Kotlin Gradle plugin in Flutter. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How Your project requires a newer version of the Kotlin Gradle plugin Error Occurs ?
I am trying to run my flutter app But I am facing following error.
[!] 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 project/android/build.gradle:
ext.kotlin_version = '<latest-version>'
How To Solve Your project requires a newer version of the Kotlin Gradle plugin Error ?
How To Solve Your project requires a newer version of the Kotlin Gradle plugin Error ?
To Solve Your project requires a newer version of the Kotlin Gradle plugin Error You need to Change dependencies in your your_project/android/build.gradle just like this: classpath ‘com.android.tools.build:gradle:4.1.0’ and in your gradle-wrapper.properties change distributionUrl to this: distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip Now, Re-run your flutter app and your error must be solved.
Your project requires a newer version of the Kotlin Gradle plugin
To Solve Your project requires a newer version of the Kotlin Gradle plugin Error You Just need to Change ext.kotlin_version in your your_project/android/build.gradle Just Change the version at
ext.kotlin_version
line: ext.kotlin_version = ‘1.6.10’ Now, Re-run your flutter app and your error must be solved.
Solution 1: Change ext.kotlin_version
You Just need to Change ext.kotlin_version in your your_project/android/build.gradle Just Change the version at ext.kotlin_version
line:
buildscript {
ext.kotlin_version = '1.6.10' // Change this
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Now, Re-run your flutter app and your error must be solved.
Solution 2: Change your build gradle
You need to Change dependencies in your your_project/android/build.gradle just like this.
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
.
.
.
}
and in your gradle-wrapper.properties change distributionUrl to this.
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
Now, Re-run your flutter app and your error must be solved.
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read