The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher

川长思鸟来 2021-11-11 10:32 601阅读 0赞

升级Gradle到最新版本后,编译提示以下错误.

  1. ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher.
  2. The following dependencies do not satisfy the required version:
  3. root project 'MyApplication' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61

报错原因是Gradle对kotlin的插件版本有要求。

解决方法

打开根目录的build.gradle,修改kotlin插件的版本。

  1. buildscript {
  2. //修改kotlin插件的版本号
  3. ext.kotlin_version = '1.3.31'
  4. repositories {
  5. google()
  6. jcenter()
  7. }
  8. dependencies {
  9. classpath 'com.android.tools.build:gradle:3.4.2'
  10. // NOTE: Do not place your application dependencies here; they belong
  11. // in the individual module build.gradle files
  12. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  13. }
  14. }

发表评论

表情:
评论列表 (有 0 条评论,601人围观)

还没有评论,来说两句吧...

相关阅读