【Android】使用国内镜像加速Android studio编译速

将app下的build.gradle中的fileallprojects和task clean的部分改为下述代码

fileallprojects {
    repositories {
        // maven库
        def cn = "http://maven.aliyun.com/nexus/content/groups/public/"
        def abroad = "http://central.maven.org/maven2/"
        // 先从url中下载jar若没有找到,则在artifactUrls中寻找
        maven {
            url cn
            artifactUrls abroad
        }
        maven { url "http://maven.aliyun.com/nexus/content/repositories/jcenter"}
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

猜你喜欢

转载自blog.csdn.net/weixin_36293343/article/details/85089969