1. 程式人生 > >【Android】使用國內映象加速Android studio編譯速

【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
}