Android Studio 0.4.2, Gradle version is confused

android-gradle-plugin, android-studio, gradle

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

Problem

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.

Original source