Android Studio 4.2 Kotlin プラグインの問題 質問する

Android Studio 4.2 Kotlin プラグインの問題 質問する

次のエラーのため、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) 

ここに画像の説明を入力してください

ベストアンサー1

から変更する

buildscript {
ext.kotlin_version = "1.5.0-release-764"
......}

への変更

buildscript {
ext.kotlin_version = "1.5.0"
....}

Kotlin バージョンを変更すると問題は解消されます。

おすすめ記事