0

According to https://developer.android.com/tools/revisions/build-tools.html, this version added support for Android 6.0 (which contains the new requestPermission methods).

Revision 23.0.0 (August 2015) 
    Added support
    for the Android 6.0 (API level 23) release.

I am using the new requestPermission method for android 6.0, but did not update the buildToolsVersion - yet the programs still works, when I expect the build process to fail (see attached image).

so the question is: what exactly does buildToolsVersion do? I like to learn why did the version 22.0.1 work when it shouldn't? Did android studio bypass the values in the build.gradle file?

enter image description here

relevant section of build.gradle

import groovy.swing.SwingBuilder
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
android {
    compileSdkVersion 23
    buildToolsVersion "22.0.1"

    compileOptions {
        encoding "UTF-8"
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }


    defaultConfig {
        //Minimum FROYO
        minSdkVersion 4
        targetSdkVersion 23


<snip off unrelated parts>

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:support-v4:23.0.1'

    //    ads: google play
    googlePlayCompile 'com.android.support:appcompat-v7:23.0.1'
    googlePlayCompile 'com.google.android.gms:play-services-ads:7.5.0'

    testCompile 'org.robolectric:robolectric:2.4'
    testCompile 'junit:junit:4.12'
}

EDIT the answer in the other question says that i have to use buildToolsVersion >= compileSdkVersion to use the new features. Yet I'm using the new features without updating the buildToolsVersion.

Community
  • 1
  • 1
Angel Koh
  • 12,479
  • 7
  • 64
  • 91
  • 1
    http://stackoverflow.com/questions/24521017/android-gradle-buildtoolsversion-vs-compilesdkversion – IntelliJ Amiya Oct 16 '15 at 09:04
  • @Amiya: this is where i got stumped... "You can use a higher version of the build-tools than your compileSdkVersion, in order to pick up new/better compiler while not changing what you build your app against." my buildTool version is lower than the compileSdkVersion (and I am using the new features in the compileSdkVersion that shouldn't exist in the older buildTool) – Angel Koh Oct 16 '15 at 09:08

1 Answers1

0

It is version of the compilers For each API level. for example if we use compileSDKversion 20 the we can use buildToolsVersion 20.0.0 or above.

Mahdi
  • 6,139
  • 9
  • 57
  • 109