kotlin-stdlib-jre7 is deprecated. Please use kotlin-stdlib-jdk7 instead

前端 未结 5 1127
你的背包
你的背包 2020-12-01 13:24

Yesterday I updated Android Studio Version and Kotlin plugin version.

Android Studio Version: 3.1.2

Kotlin Version: 1.2.41

When I create an Android p

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 14:15

    After reading Kotlin Gradle Script Topic I find out that some ponits

    If you're targeting JDK 7 or JDK 8, you can use extended versions of the Kotlin standard library which contain additional extension functions for APIs added in new JDK versions. Instead of kotlin-stdlib, use one of the following dependencies:

    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7"
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"

    I used implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" in my project. I think it's because of compileOptions set in build.graddle

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    

提交回复
热议问题