1、問(wèn)題產(chǎn)生的原因?
? ? 因?yàn)橐螺d的文件需要翻墻。
2、解決的方法
? ??修改項(xiàng)目根目錄下?build.gradle?文件,將 jcenter() 或者 mavenCentral() 替換掉即可??梢杂脟?guó)內(nèi)的倉(cāng)庫(kù)代替:
????阿里的倉(cāng)庫(kù)地址:http://maven.aliyun.com/nexus/content/groups/public/
? ??OSChina的倉(cāng)庫(kù)地址:http://maven.oschina.net/content/groups/public/
注意:必須注釋掉 jcenter()。
repositories {
google()
//? ? ? ? jcenter()
? ? ? ? maven{url'https://maven.aliyun.com/repository/jcenter'}
}
allprojects {
repositories {
google()
maven {url"https://maven.google.com" }
maven{url'https://maven.aliyun.com/repository/jcenter'}
//? ? ? ? jcenter()?
}
}
如圖配置就行了,問(wèn)題完美解決!