Gradle 构建错误:需要 Gradle 版本 2.10。当前版本是 2.6 [重复]
Posted
技术标签:
【中文标题】Gradle 构建错误:需要 Gradle 版本 2.10。当前版本是 2.6 [重复]【英文标题】:Gradle Build Error: Gradle version 2.10 is required. Current version is 2.6 [duplicate] 【发布时间】:2020-11-01 10:15:29 【问题描述】:我正在尝试运行 Gradle,但出现以下错误:
*Gradle version 2.1 is required. Current version is 2.6.
Please fix the project's Gradle settings.
Fix Gradle wrapper and re-import project
Open Gradle wrapper properties
Gradle settings*
当我点击修复 Gradle 包装器并重新导入项目时,我收到以下错误:
Support for builds using Gradle versions older than 2.6 was removed in tooling API version 5.0. You are currently using Gradle version 2.1. You should upgrade your Gradle build to use Gradle 2.6 or later.
Possible solution:
- Upgrade Gradle wrapper to 2.6 version and re-import the project
无论哪种方式,我都会收到错误消息。我是 Gradle 新手,非常困惑。如果有人能提供一些启示,我们将不胜感激。
【问题讨论】:
您的 gradle 需要更新:检查一下:***.com/questions/17727645/… 这能回答你的问题吗? How to update gradle in android studio? 【参考方案1】:使用 gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
app Level build.gradle
的配置android
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig
applicationId "com.example.cchat"
minSdkVersion 22
targetSdkVersion 29
versionCode 5
versionName "1.1"
multiDexEnabled true
compileOptions
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
【讨论】:
以上是关于Gradle 构建错误:需要 Gradle 版本 2.10。当前版本是 2.6 [重复]的主要内容,如果未能解决你的问题,请参考以下文章
Gradle 4.7构建抛出错误执行任务bootRepackage