Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 0.4.2, Gradle version is confused

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.

like image 977
Jiexi Avatar asked Jan 11 '14 23:01

Jiexi


People also ask

What version of Gradle do I have Android Studio?

Here are at least two ways you can find out the gradle version (not the gradle plugin version) by selecting one of the following on project tab on left: Android > Gradle Scripts > gradle-wrapper. properties (Gradle Version) > distributionURL.

Which Gradle version should I use?

If you are using Gradle for Android, you need to move to version 3.3 or higher of both the Android Gradle Plugin and Android Studio.

How do I sync Gradle with Android Studio?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.


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

like image 185
user2511882 Avatar answered Sep 27 '22 17:09

user2511882