【问题标题】:Gradle Build Error: Gradle version 2.10 is required. Current version is 2.6 [duplicate]Gradle 构建错误:需要 Gradle 版本 2.10。当前版本是 2.6 [重复]
【发布时间】: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 新手,非常困惑。如果有人能提供一些启示,我们将不胜感激。

【问题讨论】:

标签: android gradle version


【解决方案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
}

}

【讨论】:

    猜你喜欢
    • 2016-12-28
    • 2016-05-11
    • 1970-01-01
    • 2016-04-21
    • 1970-01-01
    • 2019-11-22
    • 2023-04-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多