1. gradle 有一个版本
2. 对应的android 插件有一个版本,貌似这两个版本要一致才行,否则就是更新半天还是错误
我具体的版本是:
1. gradle 版本:在文件 gradle-wrapper.properties 文件中
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
2. android 对应的插件版本为,如果插件较低,AS会自动提示升级
'com.android.tools.build:gradle:2.2.3'
3. build.gradle maven 可以使用阿里云的镜像,下载依赖库貌似快很多,配置如下:
//使用阿里云更新
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()
}
}