compileSdkVersion matches sdk version but “unsuppo

2019-08-28 02:08发布

问题:

With the following specs in thee 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"
}

And the sdk 25 (Android 7) installed

I get the following error by running "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.)

How can I fix that?

回答1:

Go to menu of your Android Studio and access File->Project Structure then go to Project label and change data to:

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

Press Ok and then clean and rebuild project, maybe invalidate caches and restarting before.