【问题标题】:Error: The project is using an unsupported version of Gradle错误:项目正在使用不受支持的 Gradle 版本
【发布时间】:2019-02-01 12:15:44
【问题描述】:

我的 gradle 版本在 Project 的 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 时遇到错误

项目正在使用不受支持的 Gradle 版本。 请在项目的 Gradle 设置或项目的 Gradle 包装器(如果适用)中指向受支持的 Gradle 版本。

【问题讨论】:

  • 感谢提问,非常有帮助

标签: android android-studio gradle apk build.gradle


【解决方案1】:

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

【讨论】:

  • 感谢您的回答,非常有帮助
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多