kotlin 插件更新到1.3.21

插件已经升级到1.3.21,demo 原来引用的是 1.2.41,太过老旧,升级时遇到各种引用找不到。与大家分享成功后的配置。

升级了最新版的 kotlin 插件原来的项目报一下错误,无法正常编译

ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher.
The following dependencies do not satisfy the required version:
root project 'Kotlin' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.41
Affected Modules: app

dependencies{
    
    
/** 
过时引用 @Deprecated
kotlin-stdlib-jre7 is deprecated since 1.2.0 and should be replaced with kotlin-stdlib-jdk7 less... (Ctrl+F1) 
Inspection info: This inspection reports that some deprecated dependency is used in Gradle.*/
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.30'
}
  1. ext.kotlin_version = ‘1.2.41’ ==> ext.kotlin_version = ‘1.3.21’

  2. implementation ‘org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.30’ 会显示过时,将其替换为最新的版本
    implementation ‘org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.21’ implementation ‘org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.21’

重新同步一下 File -> Sync Project with Gradle Files.

猜你喜欢

转载自blog.csdn.net/ff_hh/article/details/88392201
今日推荐