Kotlin:Runtime JAR file has version 1.1 which is older than required for API version 1.2

AndroidStudio出现形如一下的报警:

Warning:/Users/joeyzhao/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.1.2-3/552a40eb47669b78f0f194d526cb21b3aa1f8319/kotlin-stdlib-1.1.2-3.jar: Runtime JAR file has version 1.1 which is older than required for API version 1.2

 

原因:

Kotlin Runtime 的jar包低于coding使用用的的1.2版本。

 

解决:

工程(最外层与settings.build平级的)build.gradle配置:

buildscript {

    ext.kotlin_version = '1.2.0'

    repositories {
     //xxxx 你的配置项
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1' //大于2.3.3
        //xxx 你的配置项
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 
    } 
}

  

 

 

主工程build.gradle配置:

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

    //xxx 你的配置项
}

  

 

posted @ 2017-12-05 09:55  laozhao1005  阅读(2861)  评论(0)    收藏  举报