阿里源地址:https://maven.aliyun.com/mvn/view
在项目的build.grable里修改
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
//对应google()
maven {url 'https://maven.aliyun.com/repository/google'}
//对应jcenter()
maven {url 'https://maven.aliyun.com/repository/jcenter'}
//公共库
maven {url 'https://maven.aliyun.com/repository/public'}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {url 'https://maven.aliyun.com/repository/google'}
maven {url 'https://maven.aliyun.com/repository/jcenter'}
maven {url 'https://maven.aliyun.com/repository/public'}
}
}
完毕,之后sync now 一下,一下不行,就两下,以此类推。。。