gradle 2.1构建android出现错误的解决方案

时间:2022-04-22 04:41:41

转自:http://www.tuicool.com/articles/YJNJbuA

使用不同版本Gradle构建Andorid 出现Gradle version xxxx is required

坑爹啊 浪费了我好长时间,结果是gradle版本不对

http://tools.android.com/tech-docs/new-build-system/version-compatibility

改成

buildscript {

  repositories {
//mavenCentral()
maven { url "http://maven.oschina.net/content/groups/public/" }
} dependencies {
classpath 'com.android.tools.build:gradle:0.13+'
}
}

改成0.13+妹子的

Android Studio  Android Gradle Plugin  Gradle
 0.9.+ (still in development)  0.14+ (still in development)  2.1
0.8.11+  0.13+, 0.12+  2.1 (for plugin 0.13; for 0.12 use 1.10-1.12)
0.8.0 - 0.8.10  0.12+  1.10 - 1.12
0.6.0, 0.6.1+ 0.11+ 1.10 - 1.12
0.5.8 - 0.5.9 0.9, 0.10 1.10 - 1.12 (1.12 requires plugin 0.10)
0.5.0 - 0.5.7 0.9 1.10, 1.11
0.4.3 - 0.4.6 0.7, 0.8 1.9, 1.10 (required for plugin 0.8)
0.4.0 - 0.4.2 0.7 1.9
0.3.0 - 0.3.7 0.6 1.8
0.2.0 - 0.2.13 0.5