Android Studio 4.2 Kotlin 插件问题

Ibr*_*uki 31 android kotlin android-studio

由于以下错误,无法使用 Android Studio 4.2 构建新项目:

A problem occurred configuring root project 'My Application'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0-release-764.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release-764/kotlin-gradle-plugin-1.5.0-release-764.pom
       - https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release-764/kotlin-gradle-plugin-1.5.0-release-764.pom
     Required by:
         project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Run Code Online (Sandbox Code Playgroud)

当我将 Kotlin 插件版本从更改ext.kotlin_version = "1.5.0-release-764"ext.kotlin_version = "1.5.0"应用程序构建成功但出现以下警告时:

Kotlin version that is used for building with Gradle (1.5.0) differs from the one bundled into the IDE plugin (1.5.0-release-764) 
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

san*_*avi 11

更改自

buildscript {
ext.kotlin_version = "1.5.0-release-764"
......}
Run Code Online (Sandbox Code Playgroud)

改成

buildscript {
ext.kotlin_version = "1.5.0"
....}
Run Code Online (Sandbox Code Playgroud)

更改 Kotlin 版本问题将被清除。


Joh*_*len 6

这是一个已知的错误:

https://youtrack.jetbrains.com/issue/KTIJ-11590

“该问题将在 1.5.10 更新中修复”