Android Studio 中过时的 Kotlin 运行时警告

2024-05-03

下载并安装最新的 Kotlin 插件后,我有过时的 Kotlin 运行时来自 Android Studio 的警告告诉我:

您在“kotlin-stdlib-1.1.2”库中的 Kotlin 运行时版本是 1.1.2,而插件版本是1.1.2-release-Studio2.3-3。应更新运行时库以避免兼容性问题。

我尝试点击更新运行时按钮但收到另一条消息:

Gradle 项目的自动库版本更新目前是 不支持。请手动更新您的 build.gradle。

如何解决这个问题?


In your (Project: [projectName]) build.gradle file find this: ext.kotlin_version = 'x.x.x' and replace x.x.x with the current version of your Kotlin plugin. enter image description here

要检查您的 Kotlin 插件的当前版本:

  1. 转到:工具 -> Kotlin -> 配置 Kotlin 插件更新

  2. Click "Check again". After a second you will see the version of your Kotlin plugin. (If not up to date, your Kotlin plugin will be updated.) enter image description here enter image description here

N.B.:另请检查您的(Module: app) build.gradle文件并确保您不使用:

compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.21" 

but

compile 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.40'

注意区别“...jre7...” -> “...jdk7...”。同时将“1.2.40”替换为您当前的 Kotlin 插件版本。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android Studio 中过时的 Kotlin 运行时警告 的相关文章

随机推荐