错误:该项目正在使用不支持的Gradle版本

3

我的项目中Gradle版本为2.2,在gradle wrapper属性中。

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

build.gradle:

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

在构建apk时我遇到了一个错误

该项目使用的Gradle版本不受支持。 请在项目的Gradle设置或项目的Gradle包装器中指向一个受支持的Gradle版本。

1个回答

3

您可以清楚地看到,您的项目中使用的gradle版本非常老旧,不再受支持。

请确保您的计算机已安装最新的gradle版本 gradle-4.4。同时,请确保您正在使用最新的 Android Stdio 3.1.4

一旦您完成了上述最新设置,就请按照以下方式更改您的项目文件:

项目 build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.4'


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

项目 gradle/gradle-wrapper.properties

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接