rad*_*may 72 kotlin android-studio
有谁解决了这个问题?
用于使用gradle(1.1.2-5)构建的kotlin版本与捆绑到IDE插件中的版本(1.1.2-4)不同
我正在使用AS 3.0 Canary 4
谢谢
jpi*_*ihl 155
我按照@ Miha_x64的建议并升级了解决我问题的插件:
Tools- >Kotlin- >Configure Kotlin Plugin Updates- >Check for updates now
我的Android Studio版本是:
Android Studio 3.0.1
Build #AI-171.4443003, built on November 9, 2017
Run Code Online (Sandbox Code Playgroud)
RoC*_*oCk 35
在我的情况下,我将Java转换为Kotlin,我已经安装了较低版本的Kotlin.所以我更新了它.
Tools- > Kotlin- > Configure Kotlin Plugin Updates然后Check for updates now再选择Stable
但它并没有build.gradle自动从文件中更新我的版本.因为它检测到的是较新的版本而且与旧版本不同.
所以我手动将我的版本更新为最新版本
ext.kotlin_version = '1.0.0' 至 ext.kotlin_version = '1.2.41
buildscript {
ext.kotlin_version = '1.2.41'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Run Code Online (Sandbox Code Playgroud)
}
Android Studio 3.0 Canary 4中存在一个问题,导致它无法加载Kotlin插件的更新版本.您可以忽略build.gradle中Kotlin插件显示的警告,直到发布更新版本的Android Studio 3.0.
我也有同样的问题,我使用的是 Android Studio 3.2.1
将项目 build.gradle 文件(不是模块 build.gradle 文件)的 Kotlin 版本更改为最新(目前为 1.3.11)
ext.kotlin_version = '1.3.11'
Run Code Online (Sandbox Code Playgroud)
然后会有通知调用 Kotlin 迁移,点击通知上的运行迁移链接。
| 归档时间: |
|
| 查看次数: |
12743 次 |
| 最近记录: |