When I was running an old project recently, I was stuck on the download maven-metadata.xml
problem. 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.
At the beginning, it was not enough jcenter
to replace only the warehouse address , and then later google
, gradle-plugin
the warehouse address of and was replaced with Ali's mirror address. The build.gradle
configuration 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 maven
warehouse address. If the sync
synchronization project in android stuido is not working, check whether the VPN proxy is turned on, turn off the proxy, and then the clean project
project is fine .