Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The sdk platform-tools version (26.0.2) is too old to check APIs compiled with API 27; please update

I'm using IntelliJ Idea Community Edition 2017.2.5 and am building an Android app.

My problem is that even if in my app (Gradle) I have:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.0"
    defaultConfig {
        applicationId "com.app.mtvtr"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:27.0.0'
    compile 'com.android.support:design:27.0.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
    compile 'com.android.support:support-v4:27.0.0'
    testCompile 'junit:junit:4.12'
}

Also, on first build of the project, compile for the appcompat, design and support was set to 27+ (which IMHO is bad practice and is already pointed by the Studio as a bad idea), so using which tools that I have, I have set it to 27.0.1, and later to 27.0.0 just for the testing if it might work..

In my Fragments and Activities I have:

Package-code

And the warning says:

The sdk platform-tools version (26.0.2) is too old to check APIs compiled with API 27; please update

Now, I know that there are topics on SO regarding old and new versions, but I have (to my belief) set the Gradle properly and I am nowhere using platform-tools version 26 or even 26.0.2...

I have tried Restarting and invalidating caches three times.

The project properly builds onto the device and everything works. But, of course, I want to fix the warning. (And not hide it like some would suggest..)

Two things that come to mind are:

  1. I missed somewhere that I should have updated the version, maybe?
  2. I need to start a new project from scratch.

Any ideas? :)

like image 299
zed Avatar asked Nov 08 '17 11:11

zed


People also ask

How do I check my platform-tools SDK version?

Navigate to “Appearance & Behavior” > “System Settings” > “Android SDK” and now you can see the SDK versions that were installed in the “API Level” and “Name” columns (focus on “API Level”).

How do I install SDK platform-tools on Windows 10?

In your browser on the PC, open the Android SDK download page and click Download the SDK Tools ADT Bundle for Windows. On the Get the Android SDK page, you can select either 32-bit or 64-bit, according to your Windows platform. This download includes the SDK tools and the Eclipse IDE.

What is the latest Android SDK version?

Android 11 (API level 30)


1 Answers

Android Studio 3.0 will be merged into IntelliJ IDEA 2017.3 version, which will make the com.android.tools.build:gradle:3.0.0 plugin compatible with it. That will make this error to go away.

For those of you who are experiencing this issue in Android Studio, check your root build.gradle file and make sure it is updated to the above mentioned plugin version (3.0.0), in order to be able to compile against API 27 with the current latest build tools (26.0.2).

You may consequently also have to update the Gradle wrapper to the latest (4.1 at the time of this answer).

like image 58
anthonymonori Avatar answered Oct 13 '22 04:10

anthonymonori