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

XåpplI'-I0llwlg'I  - picture XåpplI'-I0llwlg'I - · May 5, 2014 · Viewed 13.9k times · Source

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?

Answer

Peter Niederwieser picture Peter Niederwieser · May 5, 2014

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).