1.http://services.gradle.org/distributions/
手动下载gradle.zip包,将zip包放到C:\Users\joeqi.gradle\wrapper\dists\gradle-4.6-all\bcst21l2brirad8k2ben1letg目录下,然后重新运行Android Studio。
2.配置阿里云镜像
buildscript {
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
maven{ url'http://maven.aliyun.com/nexus/content/groups/public/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
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 {
google()
jcenter()
maven{ url'http://maven.aliyun.com/nexus/content/groups/public/'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}