I am trying to use latest Gradle version (2.0), however I keep getting this message when hitting gradle build in terminal. Why is it asking for 1.10 version
Looks like the current version of Android Gradle plugin (0.12.2) works with Gradle of version not later than 1.12.
I haven't found a direct statement for that on the Tools site, there is this phrase only:
Gradle 1.10 or 1.11 or 1.12 with the plugin 0.11.1.
But I manually tested with Gradle 2.0 and 1.2 and it does not work, so I believe this restriction from the Tools site still applies for Android Gradle plugin 0.12.2.
I would suggest to fail back to Gradle 1.12 by setting distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-bin.zip
in your gradle-wrapper.properties
file.
Then just use gradlew
as usual.
I fix the problem updating the gradle version within build.gradle file:
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
This solve my problem. I hope this would help.
IF ABOVE FIX DO NOT WORK TRY THIS
You have to change this line in build.gradle
classpath 'com.android.tools.build:gradle:0.9.+'
in
classpath 'com.android.tools.build:gradle:1.1.+'
you have to change this line in your build.gradle
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
In
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
If you are getting this problem because you moved project developed using old Android studio to new Android Studio, then just create new project in new Android Studio and cross check your gradle related files with newly create project.
I was following wono's method on mac and I was getting "gradlew command not found" error. Fixed issue by changing mod of gradlew file
chmod +x gradlew
I hope this will help others
The Android plugin requires a particular version of Gradle. The latest Android plugin version requires 1.12, the Android plugin version declared in your build requires 1.10.