解决 Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31-release-542.

  • 新建一个项目 语言选择kotlin

解决 Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31-release-542._第1张图片

  • 报错信息
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.31-release-542.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.31-release-542/kotlin-gradle-plugin-1.5.31-release-542.pom
       - https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.31-release-542/kotlin-gradle-plugin-1.5.31-release-542.pom
     Required by:
         project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

解决 Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31-release-542._第2张图片

  • 解决如下:
  • 把项目下的build.gradle中的kotlin版本改一下即可,原来的kotlin版本如下:
    解决 Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31-release-542._第3张图片
  • 改为如下:
    解决 Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31-release-542._第4张图片
  • 点击 Try Again 再试一次,等待一会
    解决 Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31-release-542._第5张图片
  • 以上是成功

你可能感兴趣的:(kotlin,gradle,android)