Android Studio version 0.4.2, Gradle is confused

So, I just upgraded to 0.4.2, and suddenly I get an error message in the Gradle version. I tried some of these questions, saying by selecting "Use a local Gradle distribution" in the "Gradle Settings" to the one that asks for the error. So far, these are the messages I received:

You are using Gradle version 1.6, which is not supported. Please use version 1.9. Please point to a supported Gradle version in the project Gradle settings or in the project Gradle wrapper (if applicable.) You are using Gradle version 1.8, which is not supported. Please use version 1.9. Please point to a supported Gradle version in the project Gradle settings or in the project Gradle wrapper (if applicable.) Gradle version 1.6 is required. Current version is 1.9. Please fix the project Gradle settings. 

It alternated between these errors, depending on which version I am switching to, so I'm not quite sure what the problem is. In addition, I downloaded version 1.8 (-all) from the Gradle website, but other versions were downloaded by Android Studio, I believe.

+6
source share
4 answers

You need to use Gradle 1.9 with android studio 0.4.2. Point the distribution URL to Gradle 1.9 or your build.gradle should look something like this:

  buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.7.+' } } 

If this does not work, delete the Gradle directory and execute it. He must download the appropriate libraries on his own.

+17
source

If after changing the path to the variable gradle version 0.7 does not work, you may also need to change the file [yourproject] / gradle / wrapper / gradle -wrapper.properties , the distribution url in this:

 distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-bin.zip 

After this change, you may have to restart Android Studio.

+3
source

If you just change the path to the gradle class version 0.7. + doesn’t work (for me it’s not), try deleting the gradle folder from your project and then giving it a run (it should update and point to gradle 1.9 properly)

+2
source

This worked for me:

  • Update your ADT. You must have at least 22 or higher, as Google says: http://developer.android.com/sdk/installing/migrate.html 2. If you have previously built gradle files, delete all gradle files and the folder (specify "gradle" "in their names) from the project root folder
  • In the updated ADT file: File β†’ Export β†’ Generate gradle
  • In Android Studio: File β†’ Import, select the project root folder and it.
0
source

All Articles