[英]How can I upgrade Kotlin version from 1.2.51 to 1.3 on Android Studio
I'm having some trouble upgrading the version of Kotlin to 1.3-M1
or 1.3-M2
我在将Kotlin版本升级到1.3-M1
或1.3-M2
遇到了一些麻烦
I'm using 1.2.51
right now and the error I'm getting when I try using any newer versions like 1.3-M2
is: 我现在正在使用1.2.51
,当我尝试使用任何较新的版本如1.3-M2
时,我得到的错误是:
Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.3-M2.
I'm guessing it has been moved but I've looked al over and haven't found a solution. 我猜它已被移动,但我已经看了一遍,但没有找到解决方案。
Can anyone point me in the right direction? 谁能指出我正确的方向?
org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.7
Doesn't exist. 不存在。 The plugin versions use trailing zeros, so it would be: 插件版本使用尾随零,因此它将是:
org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.70
However, 1.2.71
is currently the latest, so I recommend using that instead. 但是, 1.2.71
目前是最新的,所以我建议使用它。
https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin
To update to a prerelease version of Kotlin, as described in the blog post , you need to add the kotlin-eap
repository to your build.gradle: 要更新到Kotlin的预发布版本,如博客文章中所述 ,您需要将kotlin-eap
存储库添加到build.gradle:
buildscript {
repositories {
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
}
repositories {
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
Thanks to yole and TheWanderer I found what was missing. 感谢yole和TheWanderer,我找到了遗漏的东西。
Here under the EAP-NEXT
tab you can find the correct version of the kotlin plugin for IntelliJ/Android Studio. 在 EAP-NEXT
选项卡下,您可以找到IntelliJ / Android Studio的正确版本的kotlin插件。
So this is what I did to solve it: 所以这就是我解决它的方法:
1 - Android Studio -> Tools -> Kotlin -> Configure Kotlin Plugin Updates
2 - Select Early Access Preview 1.3 on the Update channel
drop down(If you can't find it click again) 3 - What this answer says: On your project level build.gradle
: 1 - Android Studio -> Tools -> Kotlin -> Configure Kotlin Plugin Updates
2 - 在Update channel
下拉菜单中选择Early Access Preview 1.3(如果找不到它再次点击)3 - 这个答案是什么:在你的项目上level build.gradle
:
buildscript {
repositories {
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
}
repositories {
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
I just change 1.2.x version of kotlin in my gradle file like this and it worked: 我只是在我的gradle文件中更改1.2.x版本的kotlin,就像这样工作:
buildscript
{
ext.kotlin_version = '1.3.10'
repositories {
google()
jcenter()
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.