阿里云提供国内免费的镜像用于gradle的同步,速度很理想:
buildscript {
repositories {
maven { url'http://maven.aliyun.com/nexus/content/groups/public/'}
jcenter()
}
dependencies {
classpath'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url'http://maven.aliyun.com/nexus/content/groups/public/'}
jcenter()
}
}
在首次创建项目卡在build时,可以手动结束,进到该项目路径中,将build.gradle按照如上方式进行修改,可以满足快速下载的需求;
同时,将gradle手动下载下来,并在如下目录下进行修改:
设置为本地gradle路径。