Getting error "Gradle version 1.10 is required. Current version is 1.12." when executing "gradle wrapper"?
Asked Answered
P

3

12

I'm trying to execute gradle wrapper for an Android project, and this error is raised:

A problem occurred evaluating root project 'myapp'.

> Gradle version 1.10 is required. Current version is 1.12. If using the gradle wrapper, try editing the distributionUrl in /Users/dude/myapp/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip

My wrapper task in build.gradle looks like this:

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

I recently updated to Gradle v1.12 via Homebrew. Is it not supported or something? If so, where can I check this sort of thing?

Presa answered 5/5, 2014 at 4:25 Comment(1)
Try to execute: gradlew buildLillielilliputian
C
8

A particular version of the Gradle Android plugin requires a particular version of Gradle (at least for now), and it seems that your version of the Gradle Android plugin requires Gradle 1.10. You might find more information on this in the documentation for the Gradle Android plugin.

PS: The wrapper task above creates the files necessary to run Gradle with the (generated) gradlew script, which is the preferred way to run Gradle (no manual install, every build can specify in its gradle-wrapper.properties which Gradle version it needs).

Coles answered 5/5, 2014 at 6:39 Comment(3)
BTW: Recent update of Android Gradle plugin (0.10) supports Gradle versions 1.10, 1.11, and 1.12. You're probably still using Android plugin 0.8.Rusch
@Rusch Thanks, that was the problem. I had com.android.tools.build:gradle:0.9.+ specified in my build.gradle. I bumped it to 0.10.0 and now it works. If you want to add that as a separate answer I will accept it. :)Caddoan
#22253456Demented
S
2

The version of Android gradle plugin needs to be compatible with the version of Gradle. Checkout the version compatibility mapping table here: http://tools.android.com/tech-docs/new-build-system/version-compatibility

enter image description here

Streetwalker answered 22/10, 2014 at 4:56 Comment(0)
Z
1

I had the same problem. It turned out that the old Android Studio created gradle related files one level above my application folder. In my case, the path was in ~/git/, and my project was at ~/git/myproject. I used Android Studio RC2 now, and no matter how I changed the config within the project, gradle still wanted to use the old 1.10 version. Therefore, I re-checked out the project a new path, and updated the gradle version reference within the project, then it compiled.

Zayin answered 1/12, 2014 at 8:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.