具体报错内容如下所示:
Could not get resource 'https://dl.google.com appcompat-v7-24.2.1.pom'.
Unable to resolve dependency for ':app@re Classpath': Could not download
Could not get resource 'https://dl.google.com appcompat-v7-24.2.1.pom'.
Could not get resource 'https://dl.google.com appcompat-v7 appcompat-v7-24.2
Could not get resource 'https://dl.google.com appcompat-v7/24.2.1/appcompat-
Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/
Unable to resolve dependency for ':app@re Classpath': Could not download
Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Co
Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Co
总结一下 就是无法下载资源文件,在项目根目录的build.gradle中,修改
repositories {
jcenter()
google()
}
为
repositories {
maven { url "https://maven.google.com" }
jcenter()
google()
}
本文解决了一个常见的Android Studio问题,即在构建项目时遇到的资源下载失败错误。通过修改项目的build.gradle文件中的仓库地址,从使用默认的google()和jcenter()改为明确指定maven仓库的URL,成功解决了依赖项无法下载的问题。
792

被折叠的 条评论
为什么被折叠?



