修改项目下build.gradle文件
在jcenter()前添加mavenCentral()
1 // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 3 buildscript { 4 repositories { 5 mavenCentral(); 6 jcenter() 7 } 8 dependencies { 9 // classpath 'com.android.tools.build:gradle:2.0.0-alpha3' 10 classpath 'com.android.tools.build:gradle:3.4.0' 11 12 // NOTE: Do not place your application dependencies here; they belong 13 // in the individual module build.gradle files 14 } 15 } 16 17 allprojects { 18 repositories { 19 mavenCentral() 20 jcenter() 21 } 22 } 23 24 task clean(type: Delete) { 25 delete rootProject.buildDir 26 }