When AS imports a new project, it will download some dependency packages, which is often a long process. However, we can solve this problem by configuring the domestic image. Here is a record of the process of configuring the Maven image of Ali Cloud.

Ali cloud maven mirror address is maven.aliyun.com/nexus/conte… We need to find the BuildScript and AllProjects nodes in the root Gradle file of the project and replace the original Maven address with the Ali Cloud maven address in these two nodes respectively

buildscript {
    repositories {
        jcenter()
         maven { url 'http://maven.aliyun.com/nexus/content/groups/public/'}
         maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
         maven { url 'http://maven.aliyun.com/nexus/content/repositories/google'}
         maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin'}
    }
}
 
allprojects {
    repositories {
        jcenter()
//        maven { url "https://maven.google.com"}
         maven { url 'http://maven.aliyun.com/nexus/content/groups/public/'}
         maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
         maven { url 'http://maven.aliyun.com/nexus/content/repositories/google'}
         maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin'}
    }
}


Copy the code