需要 Gradle 1.10 版.当前版本是 2.0 [英] Gradle version 1.10 is required. Current version is 2.0

查看:36
本文介绍了需要 Gradle 1.10 版.当前版本是 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用最新的 Gradle 版本 (2.0),但是在终端中点击 gradle build 时我不断收到此消息.为什么要求 1.10 版本?我是 Gradle 的新手,所以我正在努力了解它.

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 版本 1.10 是必需的.当前版本为 2.0

这是我的依赖项(模块 build.gradle 文件):

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

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

...和包装任务:

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

此外,我已将分发 URL 设置如下(在 local.properties 文件中):

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

最后一点是在File->Settings->Gradle中,我选择了使用可自定义的gradle包装器"

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

GRADLE_HOME 设置为 C:Program Files (x86)Gradlegradle-2.0

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

build.gradle 文件:

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"
}

更新1

就目前而言,我使用的是带有 1.1.0-rc1 插件版本的 Android Studio 1.1.0

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-wrapper.properties 中的 Gradle 版本是 2.3

Gradle version is 2.3 in gradle-wrapper.properties

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

我尝试过插件版本 1.1.0,但它抱怨 com.android.application

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

更新 01/2016

就目前而言,我在 gradle -> wrapper -> gradle-wrapper.properties 中使用 gradle 2.9 发行版

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

插件是

classpath 'com.android.tools.build:gradle:1.5.0'

推荐答案

Android gradle 插件版本需要与 Gradle 版本兼容.查看版本兼容性映射表.

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

这篇关于需要 Gradle 1.10 版.当前版本是 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆