android studio: 让项目通过阿里云 maven jcenter 下载依赖资源


打开项目根目录下的 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
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM