android - 错误 : The project is using an unsupported version of Gradle

标签 android android-studio gradle apk build.gradle

在 Project 的 gradle wrapper 属性中,我的 gradle 版本是 2.2:

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 时遇到错误

The project is using an unsupported version of Gradle. Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)

最佳答案

您可以清楚地看到,您在项目中使用的是非常旧的 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

关于android - 错误 : The project is using an unsupported version of Gradle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52031164/

相关文章:

android - 找不到androidx.navigation :safe-args-gradle-plugin:1. 0.0-alpha01

android - 在 Android Studio 的 "build"中检测到什么错误 - Gradle 的角色

Android Studio 将外部原生构建库从多个 ABI 复制到 jniLibs

android - 从 Play 商店下载的应用程序是否可以看到 Android 日志输出?

android - 在 Android 中实现应用内购买?

android - 如何将选项添加到 Android 中现有微调器的顶部

android - 从 BroadcastReceiver 启动 WorkManager 任务

android - 同步 build.grandle 时出现 webrtc native API 'vectorDrawable' 和 'Task' 错误

java - Influx 测量 Java POJO - 缺少 @TimeColumn 装饰器(但有 @Measurement 和 @Column)

gradle - 如何在另一个子项目的gradle任务中从一个子项目调用代码?