80

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'
Nabdreas
  • 3,327
  • 4
  • 27
  • 30
  • Can you post your build.gradle file please? – apmartin1991 Jun 18 '14 at 15:30
  • 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 Jul 03 '14 at 14:15
  • 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 Jul 16 '14 at 14:58
  • 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 working – Nabdreas Jul 17 '14 at 13:39
  • 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 Feb 05 '15 at 11:27
  • Did you find the solution to this issue. I am facing same and can't find way through it . – user2273146 Feb 25 '15 at 10:02
  • @user2273146 I played around with Gradle Plugin Version and Gradle(look at the table lucas provided below). Also might want to remove .gradle folder in your /user directory or project folder, check distributionURL in gradle.wrapper.properties. Try combination from my comment 2 posts above. – Nabdreas Feb 25 '15 at 11:25
  • @Kangars you saved me! Thank you :) – iceone213 Jan 20 '16 at 16:05

8 Answers8

66

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

compatibility mapping table

Tim
  • 41,901
  • 18
  • 127
  • 145
lucas
  • 2,756
  • 19
  • 15
  • 63
    To be honest, this shows how dumb the plugin really is when it cannot use the latest version of Gradle. Seriously Google??? Sounds like the DLL hell Microsoft went through decades ago. Get with it Google. – Johann Nov 12 '14 at 16:54
  • 5
    OMG this is so stupid and annoying, Android Studio does it on every sync and automatically downgrade it for me, I am on 0.14.4 and Gradle 2.2 but it only recognizes Gradle 2.1 Anyone knows how to disable this check? – Bob Nov 22 '14 at 00:23
  • 2
    @Bob try using gradle 2.2.1, i changed gradle to 2.2 and plugin to 0.14.4 and it was asking for gradle 2.1, but changing it to 2.2.1 fixed it. – Nabdreas Dec 08 '14 at 09:39
  • 2
    What about for Android Studio 1.0.1? – Sauron Jan 01 '15 at 21:52
  • 2
    @Sauron you can use `1.0.+` for the Plugin and `2.2.1` for Gradle – Gustavo Barbosa Jan 16 '15 at 13:59
  • 1
    After every damn Android Studio update everything is a bloody mess. Google fails so hard on that one. – John Apr 03 '15 at 20:17
  • The version compatibility mapping table link got 404. – Xiaozou Sep 20 '15 at 03:31
  • Work with Java/Google/Eclipse/Intelij is a hell! – Rodrigo Dec 08 '15 at 14:56
64

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

wono
  • 743
  • 4
  • 6
  • 1
    This worked for me. While doing this, I had to install JDK and follow the post http://stackoverflow.com/questions/17587751/gradle-execution-failed-for-task-processdebugmanifest – chank Dec 18 '14 at 11:54
  • 1
    It was driving me crazy that my distributionUrl was set to the latest but the version of gradle on my machine wasn't, and gradle sync in android studio did nothing! Running './gradlew wrapper' in the terminal in android studio was exactly what i needed, it's a shame Google hasn't made that easier/more obvious... – AndroidNoob Jan 26 '16 at 12:08
16

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.

Mr.Moustard
  • 1,297
  • 21
  • 24
  • 3
    with gradle 2.1 you will need dependencies { classpath 'com.android.tools.build:gradle:0.13.+' } – Peter Szanto Oct 14 '14 at 07:50
  • 1
    yes, you're right, but with gradle 2.1 I would like to use 'dependencies { classpath 'com.android.tools.build:gradle:0.13.2' }' is better if you don't use .+ at the end. – Mr.Moustard Oct 22 '14 at 13:37
  • Worked when: dependencies { classpath 'com.android.tools.build:gradle:0.13.2' } I got around to the issue on my ends with swapping out 'com.android.tools.build:gradle:0.12.+' Strange is that I would think the original captured 'com.android.tools.build:gradle:0.13.2' – sweetiewill Dec 01 '14 at 15:51
  • 1
    Just in case you're using Gradle 2.1.1 then you should specify classpath 'com.android.tools.build:gradle:0.14.+' – Claudia Mardegan Feb 02 '15 at 13:32
5

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.

Alex Dmitriev
  • 3,664
  • 3
  • 29
  • 35
4

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.

Peter Niederwieser
  • 121,412
  • 21
  • 324
  • 259
2

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

Raheel
  • 4,953
  • 4
  • 34
  • 40
0

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.

Praveena
  • 6,340
  • 2
  • 40
  • 53
0

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'
        }
    }
kumar kundan
  • 2,027
  • 1
  • 27
  • 41