Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0-release-764.

本文解决了在使用Android Studio 4.2时遇到的Kotlin版本冲突问题,具体表现为无法找到指定版本的kotlin-gradle-plugin。通过修改项目中build.gradle文件内的Kotlin版本,成功解决了配置问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

昨天笔记本重装了系统,今天下载安装了最新的版本:Android Studio 4.2,然后创建一个新项目后就出现了异常,如下:

A problem occurred configuring root project 'HelloWorld'.
> 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

在StackOverflow上找到了答案,把项目下的build.gradle中的kotlin版本改一下即可,原来的kotlin版本如下:

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

改为如下即可:

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

此时,会提示你1.5.0版本与IDE捆绑的1.5.0-release-764版本不同(如下图),不用管它,这个版本就是没法使用的,Google公司是真粗心大意啊,搞一个不能用的版本放到这真是搞笑,在考验大家解决问题的能力呢!
在这里插入图片描述

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

android_cai_niao

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值