简体   繁体   English

如何在Android Studio上将Kotlin版本从1.2.51升级到1.3

[英]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-M11.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.

相关问题 我如何在 java android 工作室项目中添加 tls 1.3 版本 - how can ı add tls 1.3 version in java android studio project 如何在Android studio 1.3中设置gradle版本? - How do I set the gradle version in Android studio 1.3? android studio 项目升级 kotlin_version 版本 - android studio project upgrade kotlin_version version 我可以在Windows中将Android Studio版本从2.3.3升级到3.0吗? - Can I upgrade my Android Studio version from 2.3.3 to 3.0 in windows? Android Studio 从 Android Studio 从 1.2 升级到 1.3 无法在 SDK 管理器下找到预览通道 - Android Studio unable to find preview channel under SDK manager from Android studio upgrade from 1.2 to 1.3 可以选择Android Studio Kotlin版本吗? - Can choose Android Studio kotlin version? 如何在Android Studio中配置Kotlin版本? - How to configure Kotlin version in Android Studio? Android Studio 3 Kotlin版 - Android Studio 3 Kotlin version Android Gradle 插件仅支持 Kotlin Gradle 插件版本 1.2.51 及更高版本。 项目“MyApp”使用的是 1.1.51 版。 受影响的模块:app - The Android Gradle plugin supports only Kotlin Gradle plugin version 1.2.51 and higher. Project 'MyApp' is using version 1.1.51. Affected Modules: app 如何在 Android Studio 中使用 Kotlin 为 PopupMenu 编写 onPrepareOptionsMenu? - How can I write a onPrepareOptionsMenu for a PopupMenu with Kotlin in Android Studio?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM