0

My android application currently with API 22:

compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
    minSdkVersion 14
    targetSdkVersion 22
}
dependencies {
.......
compile 'com.android.support:support-v4:22.2.1'
.......

}

I would like to make a migration to API 23:

compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
    minSdkVersion 14
    targetSdkVersion 22
}
dependencies {
    .......
    compile 'com.android.support:support-v4:23.0.1'
    .......
}

So basically i need to keep my old version of targetSdkVersion 22 for the reason to test some difference in permissions, but when i'm doing this it gives me error of compilation

....\build\intermediates\res\merged\debug\values-v23\values-v23.xml
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(18) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

Question : Is it possible to keep targetSdkVersion 22?

Alexey O.
  • 220
  • 2
  • 11

3 Answers3

1

You dont need to keep targetSdkVersion 22. Android allows managing runtime permission systems via adb tool official doc.

Related part from the docenter image description here

ugur
  • 3,604
  • 3
  • 26
  • 57
1

Thank you guys for brainstorm - it works finally(code 18). Detailed check of all details gives a correct build.

compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
    minSdkVersion 14
    targetSdkVersion 22
    // Enabling multidex support.
    multiDexEnabled true
}

.... compile 'com.android.support:support-v4:23.0.1'

The reason of using targetSdkVersion 22 is to see the difference between PermissionChecker.checkSelfPermission and context.checkSelfPermission

Alexey O.
  • 220
  • 2
  • 11
1

It looks like the problem is somewhere else because I made my gradle file look the same as your and I had no problems. Have you seen this post: https://stackoverflow.com/a/26449172/5433709 ?

Community
  • 1
  • 1
Povilas Brazys
  • 78
  • 1
  • 10