Casper Bang
Casper Bang

Reputation: 569

Gradle version 1.8 is required. Current version is 1.9

Android Studio just updated itself to 0.4.2, and now fails parsing my project with the message:

Gradle version 1.8 is required. Current version is 1.9. If using the gradle wrapper, try editing the distributionUrl...

I tried various things and now it's all messed up. Kind of confused what's going on here, one should think Android Studio knows which Gradle (whatever that is) version it has/had installed?!

Is it perhaps my project which declared a dependency on 1.8, which it can no longer find due to the Studio update updating its gradle to 1.9, without also updating the existing project dependency from 1.8 to 1.9?

Upvotes: 1

Views: 3965

Answers (2)

Piyush Agarwal
Piyush Agarwal

Reputation: 25858

Update distributionUrl mentioned in your YOUR_PROJECT/gradle/gradle-wrapper.properties file, Studio(0.4.2) should automatically prompt for auto fix while gradle sync but if it didn't do it manually. distributionUrl should be like

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

Update all build.gradle files inside your project or if you are using top level build.gradle file for defining gradle version update in that only with

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

Android Studio(0.4.2) only supports Gradle 1.9 which can be defined using gradle:0.7.+ in dependency classpath.

Upvotes: 5

Jeff
Jeff

Reputation: 2248

In your project root is a gradle folder. Within that folder is a file 'gradle-wrapper.properties' open that file in a text editor and change the version in the distributionUrl from 1.8 to 1.9.

Then re-open your project.

Upvotes: 1

Related Questions