kramer65
kramer65

Reputation: 53933

I'm lost and desperate! Gradle is confused about what it wants; version 1.8 or 1.9?

I just upgraded Android studio and now Android Studio complaints about Gradle, saying:

You are using Gradle version 1.8, which is not supported. Please use version 1.9. 

So under Preferences > Compiler > Gradle, I changed the Gradle executable to /usr/local/Cellar/gradle/1.8/libexec. After rebuilding, Android Studio then complaints again, saying

Gradle version 1.8 is required. Current version is 1.9. 
If using the gradle wrapper, try editing the distributionUrl in /Applications/Android Studio.app/bin/gradle/wrapper/gradle-wrapper.properties to gradle-1.9-all.zip.

I don't know anything about a Gradle wrapper, but in my gradle.build I've got these lines for the gradle version:

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

Does anybody know how I can fix this? I'm really stuck and quite desperate! All tips are welcome!

Upvotes: 0

Views: 587

Answers (3)

Jeff S.
Jeff S.

Reputation: 1

Update both the build.gradle dependency as mentioned by keyboardsurfer and pyus13 and the distribution url found in gradle-wrapper.properties under /gradle/wrapper/.

Example:

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

Upvotes: 0

Piyush Agarwal
Piyush Agarwal

Reputation: 25858

Make sure all your build.gradle files in the project use gradle 1.9 as dependency

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

Also check your Gradle Wrapper properties file. Its available in your project structure. It must point to gradle 1.9. AFAIK you will get pop up this fix that automatically but just confirm

gradle wrapper

Upvotes: 1

Ben Weiss
Ben Weiss

Reputation: 17942

Switch to the gradle Android plugin version 0.7+

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

Then you should be able to build with gradle version 1.9.

Upvotes: 1

Related Questions