Gradle 切換阿里雲倉庫
阿新 • • 發佈:2018-12-27
轉載地址:http://xuanzhui.iteye.com/blog/2335870
原因是國內訪問jcenter太慢,甚至連線不上,就會報各種關於依賴更新失敗的錯誤。
以前oschina(也就是開源中國)提供了jcenter的映象地址,然而不幸的是因為各種原因,最近停止服務了
開源中國 Maven 映象庫關閉訪問
可以在工程gradle中如下修改,加速gradle sync
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public' }
//jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public' }
//jcenter()
}
}