SDK平台工具版本(24.0.4)太旧,无法检查使用API​​ 25编译的API;请更新

SDK平台工具版本(24.0.4)太旧,无法检查使用API​​ 25编译的API;请更新

问题描述:

我在最新版本的Android Studio上收到此错误,并且同时安装了Android SDK Platform API 25和Android SDK Build-Tools 25.

I am getting this error on the latest version of Android Studio and while I have installed both Android SDK Platform API 25 and Android SDK Build-Tools 25.

我遇到了类似的问题.在project_name/build.gradle文件中将Android Studio更新到版本2.2.2(在撰写本文时为最新)和Gradle版本为2.2.2(在撰写本文时为最新)解决了此问题.

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.

作为参考,这是我在project_name/app/build.gradle文件中的配置:

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"

这是我的dependenciesproject_name/build.gradle文件中:

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
    }
}