“需要 Gradle 版本 2.10."错误

时间:2023-02-14
本文介绍了“需要 Gradle 版本 2.10."错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为我一直在使用

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

在 build.gradle 文件中,由于 gradle version 2.10 已发布,我收到以下错误.错误是:

In the build.gradle file, I got the following error since gradle version 2.10 has been released. The error is :

警告:需要 Gradle 版本 2.10.当前版本是 2.8.如果使用 gradle 包装器,尝试编辑 distributionUrlC:Userslahblahmyprojectgradlewrappergradle-wrapper.properties到 gradle-2.10-all.zip

Warning:Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in C:Userslahblahmyprojectgradlewrappergradle-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.

我正在使用 Android Studio 2.0 和最新的 Android SDK Tools 24.4.1 和 Android SDK Build Tools 23.0.2

I'm using Android Studio 2.0 with the latest Android SDK Tools 24.4.1 and Android SDK Build Tools 23.0.2

我什至尝试下载 Gradle 2.10 并将其手动放在 android-studiogradle 文件夹中,但没有成功.

I've even tried to download Gradle 2.10 and put it manually on android-studiogradle folder, but no luck.

任何帮助将不胜感激.

推荐答案

你需要改变 File > Settings > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home 路径

在 Mac OS 上,在 Android Studio > Preferences > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home 中更改路径

On Mac OS, change the path in Android Studio > Preferences > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home

或者设置使用默认的gradle wrapper并像这样编辑Projectgradlewrappergradle-wrapper.properties文件字段distributionUrlp>

Or set Use default gradle wrapper and edit Projectgradlewrappergradle-wrapper.properties files field distributionUrl like this

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

这篇关于“需要 Gradle 版本 2.10."错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

上一篇:错误:任务':android:transformClassesAndResourcesWithPr 下一篇:错误:(6, 0) 未找到 Gradle DSL 方法:“google()"

相关文章

最新文章