【问题标题】:compileSdkVersion matches sdk version but "unsupported version of Gradle"compileSdkVersion 匹配 sdk 版本但“不支持的 Gradle 版本”
【发布时间】:2018-11-03 23:18:08
【问题描述】:

在你的 app/build.gradle 中使用以下规范

compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
    applicationId "ir.iiscenter.shub"
    minSdkVersion 16
    targetSdkVersion 25
    versionCode 25
    versionName "2.6.7"
    vectorDrawables.useSupportLibrary = true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

并安装了 sdk 25 (Android 7)

运行“Build 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.)

我该如何解决这个问题?

【问题讨论】:

    标签: android-studio android-gradle-plugin apk


    【解决方案1】:

    转到您的 Android Studio 的菜单并访问 File->Project Structure 然后转到 Project 标签并将数据更改为:

    Gradle version: 4.4
    Android Plugin Version: 3.1.2
    Android Plugin Repository: google(), jcenter
    Default Library Repository: google(), jcenter
    

    Ok 然后清理并重建项目,可能会使缓存失效并重新启动。

    【讨论】:

    • WARNING: The specified Android SDK Build Tools version (25.0.3) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2. 是什么意思?重要吗?
    • 我认为这意味着您有两个 SDK 构建工具版本,而您的 IDE 忽略了旧版本。加上我对此的回答:D 一篇文章中有两个问题。
    猜你喜欢
    • 1970-01-01
    • 2021-12-26
    • 1970-01-01
    • 2016-10-21
    • 2021-10-13
    • 2019-08-12
    • 1970-01-01
    • 2017-03-01
    • 1970-01-01
    相关资源
    最近更新 更多