解决AndroidStudio编译时报错:Could not resolve all artifacts for configuration ':classpath';


升级完AndroidStudio3.6.1编译项目报错:

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ‘:classpath’.

提示错误:Read Time out

即使开了梯子依然下载超时,我们更换为阿里云的maven库,下载速度会更快一点。

将原来配置:

repositories {
        google()
        jcenter()  
    }

repositories {
        google()      
        jcenter()
        
    }

改为:

repositories {
        google()
        maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        jcenter()
        
    }

repositories {
        google()
        maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        jcenter()
        
    }

等待一小会Gradle sync成功
在这里插入图片描述

发布了54 篇原创文章 · 获赞 1 · 访问量 6458

猜你喜欢

转载自blog.csdn.net/qq_39827677/article/details/104676952