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"

这是我在 project_name/build.gradle 文件中的 dependencies :

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