Solve the problem of android studio download maven-metadata.xml stuck

When I was running an old project recently, I was stuck on the download maven-metadata.xmlproblem. I went through various operations and did not solve the problem. For example, turning on the VPN proxy, clearing the cache, restarting the AS and computer, etc. did not solve the problem. Later I saw that it was maven cloud. If the mirror warehouse address has changed, it will try to replace it with a new address.

Insert picture description here
At the beginning, it was not enough jcenterto replace only the warehouse address , and then later google, gradle-pluginthe warehouse address of and was replaced with Ali's mirror address. The build.gradleconfiguration in the project root is as follows:

buildscript {
    
    

    repositories {
    
    
       // google()
       // jcenter()
       maven {
    
    url 'https://maven.aliyun.com/repository/google/'}
       maven {
    
    url 'https://maven.aliyun.com/repository/public/'}
       maven {
    
    url 'https://maven.aliyun.com/repository/gradle-plugin/'}
    }

}

allprojects {
    
    
    repositories {
    
    
        //google()
        //jcenter()
         maven {
    
    url 'https://maven.aliyun.com/repository/google/'}
         maven {
    
    url 'https://maven.aliyun.com/repository/public/'}
         maven {
    
    url 'https://maven.aliyun.com/repository/gradle-plugin/'}

    }
}

Change the address mavenwarehouse address. If the syncsynchronization project in android stuido is not working, check whether the VPN proxy is turned on, turn off the proxy, and then the clean projectproject is fine .

Ali maven warehouse address

Guess you like

Origin blog.csdn.net/hzw2017/article/details/114776815