The SDK platform-tools version (24.0.4) is too old to check APIs compiled with API 25; please update

自闭症网瘾萝莉.ら 提交于 2019-12-01 15:30:00

I had a similar problem. Updating Android Studio to version 2.2.2 (latest at the time of this writing) and Gradle version to 2.2.2 (latest at the time of this writing) in project_name/build.gradle file fixed this issue.

For reference, this is my config in project_name/app/build.gradle file:

minSdkVersion = 19
targetSdkVersion = 25
compileSdkVersion = 25
buildToolsVersion = "25"
supportLibraryVersion = "25.0.0"

And this is my dependencies in project_name/build.gradle file :

buildscript {

    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
        // NOTE: Do not place your application dependencies here; they belong
       // in the individual module build.gradle files
    }
}

As Vishnu said, For me updating Android studio and Gradle didn't fix the problem.

I navigated to Tools -> Android -> SDK Manager and selected BuildTools and checked for the updates related to platform tools. After updating and installing those, fixed my problem.

And for one my friends, the issue got resolved after following the above steps and then navigating to Help->Check for updates-> and installing all the available updates.

Attached Screenshot for the same.

I am facing similar issue after upgrading Android Studio to 3.0. A very simple way to fix this is go to

Tools -> Android ->SDK Manager -> SDK Tools

There look for Android SDK platform tools and update it. (Screenshot attached)

Thats it, you don't have to change any other gradle setting.

Mack Hirpara
  1. Open AndroidMainfest.xml
  2. Click the red icon => Disable inspection => Error is gone

I face same problem but when I swap

buildToolsVersion "25.0.0"

to first line then problem solved. Then the final app grade become:

android {
    buildToolsVersion "25.0.0"
    compileSdkVersion 25

    defaultConfig {
        applicationId "com.***"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 0
        versionName "0.0.0"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

Update your android sdk platform-tools to the revision from 24.0.4 to 25.x.x on sdk manager. Then android studio click File->Invalidate Caches/Restart...

The error must be gone now.

Try to update

  • Android SDK Build-Tools
  • Android SDK Platform tools
  • Android SDK Tools
  • Android Support Repository
  • Google Play Services
  • Google repository

    etc to the latest version. Error must be gone.

Go to Gradle(app) and replace

  buildToolsVersion "25"

to

  buildToolsVersion "24.0.4" // Or Latest installed gradle version 

also if targetSdkVersion is 25 then make this 24

On command line

./sdkmanager "platform-tools" "platforms;android-26"
./sdkmanager --list

Check if you have update to latest release

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!