“需要 Gradle 2.10 版."错误 [英] "Gradle Version 2.10 is required." Error
问题描述
因为我一直在使用
classpath 'com.android.tools.build:gradle:+'
在 build.gradle 文件中,自从 gradle 2.10 版 发布以来,我收到以下错误.错误是:
<块引用>警告:需要 Gradle 2.10 版.当前版本是 2.8.如果使用 gradle 包装器,尝试编辑 distributionUrlC:\Users\blahblah\myproject\gradle\wrapper\gradle-wrapper.properties到 gradle-2.10-all.zip
起初看起来很容易通过指南解决,但是当我完成更改时,我再次遇到错误.
我使用的是 Android Studio 2.0 和最新的 Android SDK 工具 24.4.1 和 Android SDK 构建工具 23.0.2>
我什至尝试下载 Gradle 2.10 并将其手动放在 android-studio\gradle\ 文件夹中,但没有成功.
任何帮助将不胜感激.
您需要更改 File > Settings > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home 路径
在 Mac OS 上,更改 Android Studio > Preferences > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home
中的路径或者设置使用默认的gradle包装器并像这样编辑Project\gradle\wrapper\gradle-wrapper.properties
文件字段distributionUrl
>
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
As I've been using
classpath 'com.android.tools.build:gradle:+'
In the build.gradle file, I got the following error since gradle version 2.10 has been released. The error is :
Warning:Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in C:\Users\blahblah\myproject\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip
at first it looks easy to solve by the guide, but when I'd done the change, I got the error again.
I'm using Android Studio 2.0 with the latest Android SDK Tools 24.4.1 and Android SDK Build Tools 23.0.2
I've even tried to download Gradle 2.10 and put it manually on android-studio\gradle\ folder, but no luck.
Any help would be appreciated.
You need to change File > Settings > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home path
On Mac OS, change the path in Android Studio > Preferences > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home
Or set Use default gradle wrapper and edit Project\gradle\wrapper\gradle-wrapper.properties
files field distributionUrl
like this
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
这篇关于“需要 Gradle 2.10 版."错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!