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版本(2.0),但是当我在terminal中访问Gradle build时,我不断地得到这个信息。为什么要1.10版本?我是新来的,所以我想让我的头脑清醒一下。
Gradle version 1.10 is required. Current version is 2.0
需要等级1.10。当前版本是2.0
Here are my dependencies (module build.gradle file):
这是我的依赖项(模块构建)。gradle文件):
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):
此外,我还将分发URL设置为如下(在本地)。属性文件):
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)\Gradle\gradle-2.0
GRADLE_HOME c:\program files (x86)\gradle\gradle - 2.0
The build.gradle file:
构建。gradle文件:
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
UPDATE1
As it stands i am using this Android Studio 1.1.0 with 1.1.0-rc1 plugin version
目前,我正在使用Android Studio 1.1.0和1.0-rc1插件版本
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0-rc1'
}
Gradle version is 2.3 in gradle-wrapper.properties
等级版本是2.3级包装
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
我尝试过插件版本1.1.0,但是它会抱怨com.android.application。
UPDATE 01/2016
更新01/2016
As it stands, i am using gradle 2.9 distribution in gradle - > wrapper -> gradle-wrapper.properties
目前,我使用的是gradle 2.9发行版,在>的包装->级-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'
8 个解决方案
#1
65
The version of Android gradle plugin needs to be compatible with the version of Gradle. Checkout the version compatibility mapping table.
Android gradle插件版本需要与gradle版本兼容。签出版本兼容性映射表。
#2
64
Message: "Gradle version 1.10 is required. Current version is 2.0"
信息:“需要1.10级版本。当前版本是2.0”
Occurs when: Attempting to build an Android project that requires 1.10 version of Gradle while using 2.0 version of it as native.
发生时:尝试构建一个Android项目,该项目需要1.10版本的Gradle,而使用2.0版本作为本地版本。
Solution: Using Gradle Wrapper
解决方案:使用Gradle封装器
Steps:
步骤:
-
Make sure the distributionUrl is specified as gradle-1.10-all.zip at the Gradle-wrapper properties file within the Android project. The file path would be like this:
确保分配url被指定为gradle-1.10-all。在Android项目中的分层包装器属性文件上压缩。文件路径如下:
MyAndroidProject/gradle/wrapper/gradle-wrapper.properties
MyAndroidProject / gradle /包装/ gradle-wrapper.properties
-
Run Gradle Wrapper command at the very top level of the project where the executable scripts (i.e. gradlew and gradlew.bat) are located.
在可执行脚本(例如gradlew和gradlew.bat)所在的项目的最高层运行Gradle包装命令。
For Unix-like OS:
类unix操作系统:
./gradlew wrapper
。/ gradlew包装
For Windows OS:
对于Windows操作系统:
gradlew.bat wrapper
gradlew。蝙蝠包装
-
Run build command with Gradle Wrapper.
使用分层包装器运行构建命令。
For Unix-like OS:
类unix操作系统:
./gradlew build
。/ gradlew构建
For Windows OS:
对于Windows操作系统:
gradlew.bat build
gradlew。蝙蝠构建
#3
16
I fix the problem updating the gradle version within build.gradle file:
我修正了在build中更新gradle版本的问题。gradle文件:
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}
This solve my problem. I hope this would help.
这解决了我的问题。我希望这能有所帮助。
#4
5
Looks like the current version of Android Gradle plugin (0.12.2) works with Gradle of version not later than 1.12.
看起来当前版本的Android Gradle插件(0.12.2)使用的版本不迟于1.12。
I haven't found a direct statement for that on the Tools site, there is this phrase only:
我还没有在工具网站上找到一个直接的声明,只有这句话:
Gradle 1.10 or 1.11 or 1.12 with the plugin 0.11.1.
第1.10级、第1.11级或第1.12级插件0.11.1。
But I manually tested with Gradle 2.0 and 1.2 and it does not work, so I believe this restriction from the Tools site still applies for Android Gradle plugin 0.12.2.
但是我用Gradle 2.0和1.2进行了手工测试,并且没有效果,所以我相信来自工具站点的限制仍然适用于Android Gradle插件0.12.2。
I would suggest to fail back to Gradle 1.12 by setting distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-bin.zip
in your gradle-wrapper.properties
file.
我建议通过设置distributionUrl=http\://services.gradle.org/distributions/gradle 1.12 bin.zip来失败1.12级。属性文件。
Then just use gradlew
as usual.
那就像平常一样使用等级。
#5
4
The Android plugin requires a particular version of Gradle. The latest Android plugin version requires 1.12, the Android plugin version declared in your build requires 1.10.
Android插件需要一个特定版本的Gradle。最新的Android插件版本需要1.12,在你的版本中声明的Android插件版本需要1.10。
#6
1
I was following wono's method on mac and I was getting "gradlew command not found" error. Fixed issue by changing mod of gradlew file
我按照wono在mac上的方法,得到了“gradlew command not found”错误。修正了通过改变渐变文件的模的问题
chmod +x gradlew
chmod + x gradlew
I hope this will help others
我希望这能帮助别人
#7
0
If you are getting this problem because you moved project developed using old Android studio to new Android Studio, then just create new project in new Android Studio and cross check your gradle related files with newly create project.
如果您遇到这个问题是因为您将使用旧的Android studio开发的项目转移到新的Android studio,那么只需在新的Android studio中创建新项目,并使用新创建的项目交叉检查您的gradle相关文件。
#8
0
IF ABOVE FIX DO NOT WORK TRY THIS
如果以上修复不工作,请尝试这个
You have to change this line in build.gradle
你必须在建筑物内改变这条线
classpath 'com.android.tools.build:gradle:0.9.+'
in
在
classpath 'com.android.tools.build:gradle:1.1.+'
you have to change this line in your build.gradle
你得在大楼里换这条线
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
In
在
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
#1
65
The version of Android gradle plugin needs to be compatible with the version of Gradle. Checkout the version compatibility mapping table.
Android gradle插件版本需要与gradle版本兼容。签出版本兼容性映射表。
#2
64
Message: "Gradle version 1.10 is required. Current version is 2.0"
信息:“需要1.10级版本。当前版本是2.0”
Occurs when: Attempting to build an Android project that requires 1.10 version of Gradle while using 2.0 version of it as native.
发生时:尝试构建一个Android项目,该项目需要1.10版本的Gradle,而使用2.0版本作为本地版本。
Solution: Using Gradle Wrapper
解决方案:使用Gradle封装器
Steps:
步骤:
-
Make sure the distributionUrl is specified as gradle-1.10-all.zip at the Gradle-wrapper properties file within the Android project. The file path would be like this:
确保分配url被指定为gradle-1.10-all。在Android项目中的分层包装器属性文件上压缩。文件路径如下:
MyAndroidProject/gradle/wrapper/gradle-wrapper.properties
MyAndroidProject / gradle /包装/ gradle-wrapper.properties
-
Run Gradle Wrapper command at the very top level of the project where the executable scripts (i.e. gradlew and gradlew.bat) are located.
在可执行脚本(例如gradlew和gradlew.bat)所在的项目的最高层运行Gradle包装命令。
For Unix-like OS:
类unix操作系统:
./gradlew wrapper
。/ gradlew包装
For Windows OS:
对于Windows操作系统:
gradlew.bat wrapper
gradlew。蝙蝠包装
-
Run build command with Gradle Wrapper.
使用分层包装器运行构建命令。
For Unix-like OS:
类unix操作系统:
./gradlew build
。/ gradlew构建
For Windows OS:
对于Windows操作系统:
gradlew.bat build
gradlew。蝙蝠构建
#3
16
I fix the problem updating the gradle version within build.gradle file:
我修正了在build中更新gradle版本的问题。gradle文件:
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}
This solve my problem. I hope this would help.
这解决了我的问题。我希望这能有所帮助。
#4
5
Looks like the current version of Android Gradle plugin (0.12.2) works with Gradle of version not later than 1.12.
看起来当前版本的Android Gradle插件(0.12.2)使用的版本不迟于1.12。
I haven't found a direct statement for that on the Tools site, there is this phrase only:
我还没有在工具网站上找到一个直接的声明,只有这句话:
Gradle 1.10 or 1.11 or 1.12 with the plugin 0.11.1.
第1.10级、第1.11级或第1.12级插件0.11.1。
But I manually tested with Gradle 2.0 and 1.2 and it does not work, so I believe this restriction from the Tools site still applies for Android Gradle plugin 0.12.2.
但是我用Gradle 2.0和1.2进行了手工测试,并且没有效果,所以我相信来自工具站点的限制仍然适用于Android Gradle插件0.12.2。
I would suggest to fail back to Gradle 1.12 by setting distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-bin.zip
in your gradle-wrapper.properties
file.
我建议通过设置distributionUrl=http\://services.gradle.org/distributions/gradle 1.12 bin.zip来失败1.12级。属性文件。
Then just use gradlew
as usual.
那就像平常一样使用等级。
#5
4
The Android plugin requires a particular version of Gradle. The latest Android plugin version requires 1.12, the Android plugin version declared in your build requires 1.10.
Android插件需要一个特定版本的Gradle。最新的Android插件版本需要1.12,在你的版本中声明的Android插件版本需要1.10。
#6
1
I was following wono's method on mac and I was getting "gradlew command not found" error. Fixed issue by changing mod of gradlew file
我按照wono在mac上的方法,得到了“gradlew command not found”错误。修正了通过改变渐变文件的模的问题
chmod +x gradlew
chmod + x gradlew
I hope this will help others
我希望这能帮助别人
#7
0
If you are getting this problem because you moved project developed using old Android studio to new Android Studio, then just create new project in new Android Studio and cross check your gradle related files with newly create project.
如果您遇到这个问题是因为您将使用旧的Android studio开发的项目转移到新的Android studio,那么只需在新的Android studio中创建新项目,并使用新创建的项目交叉检查您的gradle相关文件。
#8
0
IF ABOVE FIX DO NOT WORK TRY THIS
如果以上修复不工作,请尝试这个
You have to change this line in build.gradle
你必须在建筑物内改变这条线
classpath 'com.android.tools.build:gradle:0.9.+'
in
在
classpath 'com.android.tools.build:gradle:1.1.+'
you have to change this line in your build.gradle
你得在大楼里换这条线
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
In
在
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}