建议使用阿里云的镜像服务器,避免翻不了墙的尴尬。使用以下配置
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
//阿里云镜像
maven {
allowInsecureProtocol true
url 'https://maven.aliyun.com/nexus/content/repositories/google' }
maven {
allowInsecureProtocol true
url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven {
allowInsecureProtocol true
url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
//阿里云镜像
maven {
allowInsecureProtocol true
url 'https://maven.aliyun.com/nexus/content/repositories/google' }
maven {
allowInsecureProtocol true
url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven {
allowInsecureProtocol true
url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
mavenCentral()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}