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

标签 android android-studio kotlin kotlin-android-extensions

下载并安装最新的 Kotlin 插件后,我收到来自 Android Studio 的 Outdated Kotlin Runtime 警告,告诉我:

Your version of Kotlin runtime in 'kotlin-stdlib-1.1.2' library is 1.1.2, while plugin version is 1.1.2-release-Studio2.3-3. Runtime library should be updated to avoid compatibility problems.

我尝试点击 Update Runtime 按钮,但收到另一条消息:

Automatic library version update for Gradle projects is currently unsupported. Please update your build.gradle manually.

如何解决这个问题?

最佳答案

在你的 (Project: [projectName]) build.gradle 文件中找到这个: ext.kotlin_version = 'x.x.x' 并将 x.x.x 替换为您的 Kotlin 插件的当前版本。 enter image description here

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

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

  2. 点击“再次检查”。一秒钟后,您将看到 Kotlin 插件的版本。 (如果不是最新的,您的 Kotlin 插件将被更新。) enter image description here enter image description here

注意:还要检查您的 (Module: app) build.gradle 文件并确保您不使用:

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

但是

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

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

关于android - Android Studio 中过时的 Kotlin 运行时警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43928118/

相关文章:

firebase - 如何从 Firestore 数据库返回列表作为 Kotlin 中函数的结果?

android - 向所有注册设备广播通知

android - 更改 Flutter Snackbar 的位置

android - 在屏幕旋转时显示嵌套 fragment 而不显示父 fragment

android-studio - Android Studio - 无法使用 Fabric 插件部署签名的 APK

ios - 如何测试和导出使用 LibGDX 制作的 iOS 应用程序

java - 数据库中的数据未显示

android - Instant Run 执行了完整的构建和安装,因为设备上的安装与磁盘上的本地构建不匹配

android - 错误 : Cannot access database on the main thread since it may potentially lock the UI for a long period of time. - 使用 Kotlin 的 Android Room

kotlin - 如何将项目添加到 Kotlin 中的 ArrayList?