Android Studio Could not resolve all artifacts for configuration ‘:classpath‘.
发布日期:2021-07-01 00:00:30
浏览次数:2
分类:技术文章
本文共 1770 字,大约阅读时间需要 5 分钟。
前言
今天在运行一个demo的时候 一直下载超时 也设置了阿里云的镜像 还是不行
最后查看log错误信息 是因为google的地址访问不到造成的 添加了阿里云镜像 还是read time out 超时错误提示
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ‘:classpath’.
解决方法
在app build.gradle里 查看配置 看看是不是配置了google的下载地址
在国内访问google是走不通的 所以下载会超时maven { url "https://maven.google.com" }
添加阿里云镜像
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/'} maven { url'https://maven.aliyun.com/repository/public/' } maven { url'https://maven.aliyun.com/repository/google/' } maven { url'https://maven.aliyun.com/repository/jcenter/' } maven { url'https://maven.aliyun.com/repository/central/'}
全部配置代码
buildscript { repositories { maven { url 'http://maven.aliyun.com/nexus/content/groups/public/'} maven { url'https://maven.aliyun.com/repository/public/' } maven { url'https://maven.aliyun.com/repository/google/' } maven { url'https://maven.aliyun.com/repository/jcenter/' } maven { url'https://maven.aliyun.com/repository/central/'} } dependencies { classpath 'com.android.tools.build:gradle:3.4.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}allprojects { repositories { maven { url 'http://maven.aliyun.com/nexus/content/groups/public/'} maven { url'https://maven.aliyun.com/repository/public/' } maven { url'https://maven.aliyun.com/repository/google/' } maven { url'https://maven.aliyun.com/repository/jcenter/' } maven { url'https://maven.aliyun.com/repository/central/'} }}
总结
要心细,心细,心细!
转载地址:https://lvshichunqiu.blog.csdn.net/article/details/113921601 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
路过按个爪印,很不错,赞一个!
[***.219.124.196]2024年04月23日 00时42分39秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!