不推荐使用kotlin-stdlib-jre7.请改用kotlin-stdlib-jdk7 [英] kotlin-stdlib-jre7 is deprecated. Please use kotlin-stdlib-jdk7 instead
问题描述
昨天我更新了Android Studio版本和Kotlin插件版本.
Yesterday I updated Android Studio Version and Kotlin plugin version.
Android Studio版本:3.1.2
Android Studio Version: 3.1.2
科特林版本:1.2.41
Kotlin Version: 1.2.41
使用此配置创建Android项目时,出现Kotlin Compiler警告
When I create an Android project using this configuration, I get Kotlin Compiler warning saying
w:/home/ganeshtikone/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.2.41/9e7a6f582de73d9cdc6c56ef4e23604a0ee55768/kotlin-stdlib-jre7-1.2.41 .jar:不建议使用kotlin-stdlib-jre7.请改用kotlin-stdlib-jdk7
w: /home/ganeshtikone/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.2.41/9e7a6f582de73d9cdc6c56ef4e23604a0ee55768/kotlin-stdlib-jre7-1.2.41.jar: kotlin-stdlib-jre7 is deprecated. Please use kotlin-stdlib-jdk7 instead
根据建议更改,然后出现以下错误
Changed as per suggestion, then I am getting following error
意外输入:ImmutableJarInput {name = org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.41,file =/home/ganeshtikone/Workspace/May-2018/fhs/app/build/intermediates/transforms/desugar /stage/debug/45.jar,contentTypes = CLASSES,scopes = EXTERNAL_LIBRARIES,status = REMOVED}
Unexpected inputs: ImmutableJarInput{name=org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.41, file=/home/ganeshtikone/Workspace/May-2018/fhs/app/build/intermediates/transforms/desugar/stage/debug/45.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}
推荐答案
转到工具> Kotlin>配置Kotlin插件更新,并检查更新 然后在应用gradle文件中将 jre 替换为 jdk
Go to Tools > Kotlin > Configure Kotlin Plugin Updates and check for updates then in your app gradle file replace jre with jdk
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
这篇关于不推荐使用kotlin-stdlib-jre7.请改用kotlin-stdlib-jdk7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!