Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio says to use Gradle 1.10 - but new version is 1.12?

The error:

The project is using an unsupported version of Gradle.  Please use version 1.10.


My `gradle.build` file says this:

dependencies {
      classpath 'com.android.tools.build:gradle:0.12.+'
}

As far as I know, the above line is correct. My gradle-wrapper file says:

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

This happened when I downloaded the newest Android Studio beta (v.8) and tried to import an app that had, what I assume is an old version of Gradle.

Also, when I hit "Fix Gradle Wrapper and re-import project", nothing happens.

like image 888
TheLettuceMaster Avatar asked Jun 27 '14 20:06

TheLettuceMaster


2 Answers

If you want to change the gradle-wrapper to a lower version you have to change distributionUrl to

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

and then rerun the wrapper task. If this isn't enough just delete the folders .gradle and gradle and the files gradlew and gradlew.bat. The rerun wrapper and he downloads gralde 1.10

Since gradle had some major api changes from version 1.10 and 1.12 you can not build any project with a higher version then the plugins are build with. So if the android plugin is build with gradle 1.10 you have to use the same version

like image 123
The End Avatar answered Sep 28 '22 13:09

The End


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

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

What should be done to resolve this problem: Updating the gradle version within build.gradle file

dependencies {
    classpath 'com.android.tools.build:gradle:0.12.2+'
}

replacing it with

dependencies {
    classpath 'com.android.tools.build:gradle:1.0.+'
}
like image 32
Abhishek Tamta Avatar answered Sep 28 '22 12:09

Abhishek Tamta