打開項目根目錄下的 build.gradle(Project:項目名稱一級的gradle),如下所示添加阿里 maven 庫地址:
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { // 添加阿里雲 maven 地址 maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } // jcenter() google() } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { // 添加阿里雲 maven 地址 maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } // jcenter() google() } } task clean(type: Delete) { delete rootProject.buildDir }
