Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
194 views
in Technique[技术] by (71.8m points)

android - Gradle version 1.10 is required. Current version is 2.0

I am trying to use latest Gradle version (2.0), however I keep getting this message when hitting gradle build in terminal. Why is it asking for 1.10 version? I am new to Gradle, so I'm trying to get my head around it.

Gradle version 1.10 is required. Current version is 2.0

Here are my dependencies (module build.gradle file):

dependencies {
    classpath 'com.android.tools.build:gradle:0.12.+'
    classpath fileTree(dir: 'build-libs', include: '*.jar')
}

...and wrapper task:

task wrapper(type: Wrapper) {
    gradleVersion = "2.0"
}

Also, I have set the distribution URL as follows (in the local.properties file):

distributionUrl=https://services.gradle.org/distributions/gradle-2.0-all.zip

The final thing is that in File->Settings->Gradle, I selected "Use customizable gradle wrapper"

GRADLE_HOME is set to C:Program Files (x86)Gradlegradle-2.0

The build.gradle file:

buildscript {

    repositories {
        mavenLocal()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.+'
        classpath fileTree(dir: 'build-libs', include: '*.jar')
    }
}


task wrapper(type: Wrapper) {
    gradleVersion = "2.0"
}

UPDATE1

As it stands i am using this Android Studio 1.1.0 with 1.1.0-rc1 plugin version

    dependencies {
    classpath 'com.android.tools.build:gradle:1.1.0-rc1'
}

Gradle version is 2.3 in gradle-wrapper.properties

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

I have tried plugin version 1.1.0, but then it complains about com.android.application

UPDATE 01/2016

As it stands, i am using gradle 2.9 distribution in gradle - > wrapper -> gradle-wrapper.properties

distributionUrl=https://services.gradle.org/distributions/gradle-2.9-all.zip

and plugin is

classpath 'com.android.tools.build:gradle:1.5.0'
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The version of Android gradle plugin needs to be compatible with the version of Gradle. Checkout the version compatibility mapping table.

compatibility mapping table


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...