在更目录的 build.gradle 下添加两行配置
buildscript { repositories { google() maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/' } jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/' } jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }