I'm new to this, I bought a Flutter project and am trying to start it in Android Studio.
The project used an older version of Android Gradle and I updated it to 7.0.2. But now when I try to build, I get the error:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.40 and higher.
I checked the file android/build.gradle ext.kotlin_version = '1.3.50'
Here is the complete file:
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
maven {
url "https://dl.bintray.com/kotlin/kotlin-eap/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I tried to change many versions but always the result is the same. I checked a lot of answers but still couldn't find what else could be the reason.
CodePudding user response:
Try this:
buildscript {
ext.kotlin_version = '1.5.30'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
}
}