升级Gradle到最新版本后,编译提示以下错误.
ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher.
The following dependencies do not satisfy the required version:
root project 'MyApplication' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61
报错原因是Gradle对kotlin的插件版本有要求。
打开根目录的build.gradle,修改kotlin插件的版本。
buildscript {
//修改kotlin插件的版本号
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}