“需要 Gradle 版本 2.10."错误

quot;Gradle Version 2.10 is required.quot; Error(“需要 Gradle 版本 2.10.错误)
本文介绍了“需要 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.1Android 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."错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)