【问题标题】:The SDK platform-tools version (24.0.3) is too old to check APIs compiled with API 25 [Warning]SDK 平台工具版本 (24.0.3) 太旧,无法检查使用 API 25 编译的 API [警告]
【发布时间】:2016-12-13 06:32:27
【问题描述】:

我知道这个问题已经被问过很多次了,但无法为我解决。

Main Project Gradle

dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

App Module Gradle File

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
    applicationId "com.something"
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

所以问题是它从哪里获取构建工具版本24.0.3,因为我已将其设置为25.0.1

只是一头雾水!!

【问题讨论】:

  • 你使用的是 Support lib version 25.0.1 吗? compile 'com.android.support:appcompat-v7:25.0.1'
  • @Basi 确实如此!
  • 清理-重建-重启
  • @IntelliJAmiya Clean-Rebuild-Restart 完成但结果相同。还完成了Invalidate Case & Restart 也不起作用!
  • 查看你的库模块,它将使用这个版本。

标签: android gradle android-gradle-plugin build.gradle build-tools


【解决方案1】:

有3个步骤: 你可以试试这样。我也有同样的问题。

【讨论】:

    【解决方案2】:

    试着这样设置

    android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.something"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
      }
     }
    

    并添加编译com.android.support:appcompat-v7:25.0.1

    【讨论】:

      【解决方案3】:

      我遇到了同样的问题并通过执行以下步骤解决了:

      1.请尝试卸载您的旧平台工具,例如24.0.3

      2.然后安装推荐的平台工具。

      3.重启Android studio,就OK了

      【讨论】:

        猜你喜欢
        • 2017-03-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-10-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多