【发布时间】:2021-07-27 19:10:42
【问题描述】:
由于以下错误,无法使用 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
当我将 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)
【问题讨论】:
-
但是我想用最新的
Kotlin版本 -
Kotlin 1.5 还没有作为稳定版本发布,Android Studio Canary 应该使用 Kotlin 1.5 而不是最新的稳定版本
-
@Wang 谁说不稳定?您是从哪里获得这些信息的?
-
我认为这是新版本的错误。每当我收到此警告时,更新版本都会使警告消失,并且我处于最新的稳定版本。这似乎在新版本中是不可能的,除非缺少一些 gradle 设置,阻止它找到捆绑版本。
标签: android android-studio kotlin