Android Studio 下载 gradle 速度慢解决方法
- 首先找到工程的build.gradle文件
- 注释掉 jcenter() ,修改成阿里云镜像
注:我用的gradle版本为5.1.1,对应插件版本3.4.1(gradle版本与插件版本需一一对应)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
// jcenter()
maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
// 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
}