当前位置: 首页 > 知识库问答 >
问题:

Gradle构建错误:Gradle版本2.10是必需的。当前版本为2.6[重复]

萧修永
2023-03-14

我试图运行一个分级,但我得到以下错误:

*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*
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是新的,非常困惑。如果有人能给我点启示,我将不胜感激。

共有1个答案

顾昊穹
2023-03-14

使用gradle-wrapper.properties

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

这个配置用于应用程序级别的构建。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
}

}
 类似资料: