Android Studio Could not resolve all artifacts for configuration :classpath

熊猫卓Sun 2020年06月14日 133次浏览

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

解决:
修改build.gradle

buildscript {
	repositories {
	        google()
	        jcenter()  
	    }
    }
allprojects {
	repositories {
	        google()      
	        jcenter()
	        }
    }

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

然后同步项目
截止有必要的话清理缓存并重启AS