https://www.jianshu.com/p/ab1f5e5f5f5c
我们的目标就是:让天下没有困难的编程
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.0.1‘
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
google()
}
}
上面的这种方式,由于会用到google的maven仓库,直接导致相关的依赖库无法下载,gradle plug3.0无法下载的问题。
http://maven.aliyun.com/nexus/content/groups/public/
http://maven.aliyun.com/nexus/content/repositories/jcenter
http://maven.aliyun.com/nexus/content/repositories/google
buildscript {
repositories {
// mavenCentral()
// jcenter()
// google()
maven { url ‘https://plugins.gradle.org/m2/‘ }
maven { url ‘http://maven.aliyun.com/nexus/content/repositories/google‘ }
maven { url ‘http://maven.aliyun.com/nexus/content/groups/public/‘ }
maven { url ‘http://maven.aliyun.com/nexus/content/repositories/jcenter‘}
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.0.1‘
}
}
allprojects {
repositories {
// mavenCentral()
// jcenter()
// google()
maven { url ‘https://plugins.gradle.org/m2/‘ }
maven { url ‘http://maven.aliyun.com/nexus/content/repositories/google‘ }
maven { url ‘http://maven.aliyun.com/nexus/content/groups/public/‘ }
maven { url ‘http://maven.aliyun.com/nexus/content/repositories/jcenter‘}
}
}
别忘了关注我们的公众号
原文:https://www.cnblogs.com/sundaysandroid/p/13495008.html