因为公司项目需要低版本gradle,加上同事其他项目也是需要低版本gradle,要更换gradle,使用2.14.1,于是遇到了如下报错,百度了,很多人都没有直接的办法,直接放弃去找已经下载的使用。看了一篇文章
https://www.cnblogs.com/jycboy/p/5819393.html
,觉得有用,想了很久(本人比较笨),明白了自己为什么每次更换gradle都栽在这里,“
对gradle和gradle plugin(gradle插件)
”的使用没弄明白。
补充知识
:As、gradle 和gradle plugin见
https://blog.csdn.net/gongxiaoou/article/details/81082387
如果使用的gradle和gradle plugin的版本是对应的,在联网状态下,这些内容会自动下载,就不会存在找不到资源文件的问题了。下面讲一下gradle和gradle plugin
Error:A problem occurred configuring root project 'Client'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:2.14.1.
Searched in the foll
因为公司项目需要低版本gradle,加上同事其他项目也是需要低版本gradle,要更换gradle,使用2.14.1,于是遇到了如下报错,百度了,很多人都没有直接的办法,直接放弃去找已经下载的使用。看了一篇文章https://www.cnblogs.com/jycboy/p/5819393.html,觉得有用,想了很久(本人比较笨),明白了自己为什么每次更换gradle都栽在这里,“对gradle...
升级完AndroidStudio3.6.1编译项目
报错
:
Caused by: org.
gradle
.api.internal.artifacts.ivyservice.DefaultLenient
Configuration
$Artifact
Resolve
Exception: Could not
resolve
all artifacts for
configuration
‘:
classpath
’.
提示错误:Read Time out
即使开了梯子依然下载超时,我们
更换
为阿里云的maven库,下载速度会更快一点。
将原来配置:
repositories {
google()
Caused by: org.
gradle
.api.internal.artifacts.ivyservice.DefaultLenient
Configuration
$Artifact
Resolve
Exception: Could not
resolve
all artifacts for
configuration
‘:
classpath
’.
百度说是无法下载
classpath
里的内容,具体不是很清楚
解决方法:
百度到了很多方法,单个尝试都解决不了,然后把解决方法结合
在build.
gradle
里
buildscript {
repositories {
每次拉取其它分支,上图中红框中
文件
就会消失,启动项目,
报错
:
A problem occurred configuring root project 'project_name'.
> Could not
resolve
all
dependencies
for
configuration
':
classpath
'.
> Using insecure protocols with repositories, without explicit opt-in, is unsu...
> Could not
resolve
all
dependencies
for
configuration
':
classpath
'.
> Could not download commons-lang3.jar (org.apache.commons:commons-lang3:3.3.2)
> Could not get resource 'http://jcenter
android studio出现Could not
resolve
all
dependencies
for
configuration
‘:app:debugRuntime
Classpath
’. Could not create task ‘:app:minifyReleaseWithR8’. Cannot query the value of this provider because it has no value available.
解决
报错
:Could not
resolve
all depen
报错
是由于
gradle
下载包时连接失败,可在modules的build.
gradle
中添加阿里的maven库地址重编译解决
repositories {
maven{ url = "https://maven.aliyun.com/repository/google" }
maven{ url = "https://maven.aliyun.com/repository/public" }
google()
mavenCentral()
> Could not
resolve
all
dependencies
for
configuration
':
classpath
'.
> Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository
'maven3(http://o
一劳永逸方法
网上的其他方法比如修改compileSdkVersion,buildToolsVersion,和appcompat的版本号,虽然可以解决问题,但是下一次新建项目的时候还会出现,又得继续改版本号。下面的解决方法可以一次性解决
在你的AndroidStudio中找到这个目录。
android-studio-ide-2.3.3\android-studio\
plugin
s\android\lib\templates\
gradle
-projects\NewAndroidProject\root\
找到build.
gradle
.ftl
文件
编辑 ,在
allprojects
最近因为换了个台式电脑,重新下载了最新的android studio ,2020年5月6号的3.6.3版本,
结果编译工程和新建工程,都直接就报了以下错误:
Could not
resolve
all
dependencies
for
configuration
‘:
classpath
’.
Could not
resolve
com.android.tools.build:
gradle
:2.1.2.
等6个error
上网百度csdn,结果试下各种方法,依旧没用。
搞了一天,直接说结果,我这边时用户名时中文的原因。我解决的办法时重新安装了系统,用户名改成了英文。
以下我总结了: 我
具体情况:
mac环境,intellij 2020.2版本,新建的
gradle
空的工程,在
gradle
配置中,先是引用了本地安装的
gradle
版本
gradle
-6.8-rc-4,并且在
gradle
的配置中,如下图,将 “
gradle
user home”设置成了本地安装的
gradle
-6.8-rc-4目录。
然后新起的一个
gradle
java工程,无论添加什么依赖,都会
报错
“Could not
resolve
…依赖…”
解决方法:intellij中,删除
Gradle
user home 的路径,然
更换gradle,引起文件缺失报错 Could not resolve all dependencies for configuration ':classpath'.
Dreams孜然: