80
votes

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? I am new to Gradle, so I'm trying to get my head around it.

Gradle version 1.10 is required. Current version is 2.0

Here are my dependencies (module build.gradle file):

dependencies {
    classpath 'com.android.tools.build:gradle:0.12.+'
    classpath fileTree(dir: 'build-libs', include: '*.jar')
}

...and wrapper task:

task wrapper(type: Wrapper) {
    gradleVersion = "2.0"
}

Also, I have set the distribution URL as follows (in the local.properties file):

distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-all.zip

The final thing is that in File->Settings->Gradle, I selected "Use customizable gradle wrapper"

GRADLE_HOME is set to C:\Program Files (x86)\Gradle\gradle-2.0

The build.gradle file:

buildscript {

    repositories {
        mavenLocal()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.+'
        classpath fileTree(dir: 'build-libs', include: '*.jar')
    }
}


task wrapper(type: Wrapper) {
    gradleVersion = "2.0"
}

UPDATE1

As it stands i am using this Android Studio 1.1.0 with 1.1.0-rc1 plugin version

    dependencies {
    classpath 'com.android.tools.build:gradle:1.1.0-rc1'
}

Gradle version is 2.3 in gradle-wrapper.properties

distributionUrl=http\://services.gradle.org/distributions/gradle-2.3-all.zip

I have tried plugin version 1.1.0, but then it complains about com.android.application

UPDATE 01/2016

As it stands, i am using gradle 2.9 distribution in gradle - > wrapper -> gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip

and plugin is

classpath 'com.android.tools.build:gradle:1.5.0'
8
Can you post your build.gradle file please?apmartin1991
Still having this problem. plugin is set to 0.12.+ and im using official release of Gradle 2.0. Cant find any traces of 1.10. Why is it asking for it :(Nabdreas
did you generate the wrapper for 1.10? Im having same issues. Please post an update if you got this working. I've just returned to a gradle based project and cant get it going again despite trying to regenerate the wrappers.RichieHH
Nope no luck with 2.0, ive been using 1.12 for now. If i manage to find a solution i will sure post it! On thing that might help is removing .gradle folder in C:/User. I had to do it to make 1.12 workingNabdreas
If it helps, as it stands i am using Gradle 2.2.1, Plugin 1.0.1 and AS version 1.1 Preview 2. No problems at all.Nabdreas

8 Answers

66
votes

The version of Android gradle plugin needs to be compatible with the version of Gradle. Checkout the version compatibility mapping table.

compatibility mapping table

64
votes

Message: "Gradle version 1.10 is required. Current version is 2.0"

Occurs when: Attempting to build an Android project that requires 1.10 version of Gradle while using 2.0 version of it as native.

Solution: Using Gradle Wrapper

Steps:

  1. Make sure the distributionUrl is specified as gradle-1.10-all.zip at the Gradle-wrapper properties file within the Android project. The file path would be like this:

    MyAndroidProject/gradle/wrapper/gradle-wrapper.properties

  2. Run Gradle Wrapper command at the very top level of the project where the executable scripts (i.e. gradlew and gradlew.bat) are located.

    For Unix-like OS:

    ./gradlew wrapper

    For Windows OS:

    gradlew.bat wrapper

  3. Run build command with Gradle Wrapper.

    For Unix-like OS:

    ./gradlew build

    For Windows OS:

    gradlew.bat build

16
votes

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.

5
votes

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.

4
votes

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.

2
votes

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

0
votes

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.

0
votes

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'
        }
    }