Reputation: 3447
The benefits of the support libraries are the fact that I can run later released feature like Material Design things on a older version of android.
So why is it not possible to change the comileSdk to e.g. 22 and the support libraries to the newest version?
My Gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.stack.overflow"
minSdkVersion 22
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main { res.srcDirs = ['src/main/res', 'src/main/res/drawable/ic_action_search.png'] }
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//Google Libraries
compile 'com.android.support:appcompat-v7:23.0.+'
compile 'com.android.support:recyclerview-v7:23.0.+'
compile 'com.android.support:cardview-v7:23.0.+'
}
Android studio always marks the google libraries red and does not compile.
So why is it not possible to use the latest support libraries with a previous sdk?
Upvotes: 1
Views: 130
Reputation: 75788
Please update your targetSdkVersion 23
Finally
android {
compileSdkVersion 23
buildToolsVersion "23.0.0" or '23.0.1'
defaultConfig {
applicationId "com.stack.overflow"
minSdkVersion 17 // Set Your Version
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
And you can set
compile 'com.android.support:appcompat-v7:23.0.0'
Upvotes: 2