Android Studio中过时的Kotlin运行时警告 [英] Outdated Kotlin Runtime warning in Android Studio

查看:214
本文介绍了Android Studio中过时的Kotlin运行时警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下载并安装了最新的Kotlin插件后,我收到了来自Android Studio的过时的Kotlin运行时警告,提示我:

After downloaded and installed latest Kotlin plugin I have Outdated Kotlin Runtime warning from Android Studio that telling me:

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

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.

我试图单击更新运行时按钮,但又收到另一条消息:

I tried to click Update Runtime button but getting another message:

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

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

如何解决此问题?

推荐答案

您可以在项目级别build.gradle文件中更新Kotlin版本.如果按常规方式配置了它,则应该在顶部附近添加以下行:

You can update your Kotlin version in your project level build.gradle file. If you have it configured the usual way, you should have the following line in it around the top:

ext.kotlin_version = '1.1.2'

要升级到与您的插件匹配的版本,只需将此行更改为:

To upgrade to the version matching your plugin, simply change this line to:

ext.kotlin_version = '1.1.2-3'


编辑(以回答以下问题):


Edit (to respond to a question below):

该错误告诉您需要升级版本,问题是在哪里可以找到必须放入1.1.2-3而不是例如1.1.2-release-Studio2.3-3的信息.

The error tells you that you need to upgrade your version, the question is where to find out that you have to put in 1.1.2-3 instead of saying, for example, 1.1.2-release-Studio2.3-3.

找出Kotlin最新版本的最佳方法是转到 kotlinlang.org 并查找最新".版本".应该在首页上.

The best way to find out the latest version of Kotlin is by going to kotlinlang.org and looking for "Latest version". Should be right there on the front page.

如果版本号很重要,那么要做的另一件事是检查托管版本的存储库.对于Android,您可能会从jcenter获得它,您可以在其中找到存储库页面,其中列出了所有可用版本.

Another thing to do if the version number is non-trivial like this is to check the repositories where the versions are hosted. In the case of Android, you'll probably be getting it from jcenter, for which you can find the repository page, which has all the available versions listed.

您还可以通过此处,或在 mvnrepository mavencentral (后者此处)的原始版本).

You can also browse the raw maven repository of jcenter where the files are actually hosted by going here, or look up Kotlin either on mvnrepository or on mavencentral (raw version of the latter here).

这篇关于Android Studio中过时的Kotlin运行时警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆