Question

So I just updated to 0.4.2 and all of a sudden I'm getting an error about the Gradle version. I tried some stuff the similar questions said by choosing "Use local gradle distribution" in "Gradle Settings" to the one that the error is asking for. So far, these are the messages I've been getting:

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's Gradle settings or in the project's 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's Gradle settings or in the project's Gradle wrapper (if applicable.)

Gradle version 1.6 is required. Current version is 1.9.
Please fix the project's Gradle settings.

It's been alternating between those errors depending on which version I switch to, so I'm not really sure what the problem is. Also, I did download version 1.8(-all) from the gradle website, but the other versions have been downloaded by Android Studio I believe.

Was it helpful?

Solution

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 that doesn't work delete the gradle directory and give it a run. It should download the appropriate libraries on its own

OTHER TIPS

If doesn't work after changing the classpath to gradle version 0.7 you may also have to change in [yourproject]/gradle/wrapper/gradle-wrapper.properties file, 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.

If simply changing the classpath to gradle version 0.7.+ didn't work ( for me it didn't ), also try deleting the gradle folder from your project and then give it a run ( it should refresh itself and point to Gradle 1.9 properly )

This worked for me:

  1. Update your ADT. You must have at least 22 or higher as is written by Google: http://developer.android.com/sdk/installing/migrate.html 2.If you previously built gradle files, remove all gradle files and folder (contain 'gradle' in their names) from your root project folder
  2. In your updated ADT: File -> Export -> Generate gradle build file
  3. In Android Studio: File -> Import, choose your project root folder and that's it.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top