I installed Android Studio 1.4 .By default it has settings for compiler sdk and target sdk as MARSHMALLOW . So if i generated final APK after completion of my project, is it works in previous versions of android with out any error ..??
Asked
Active
Viewed 1,858 times
3 Answers
0
No Absolutely Not
To work fine you have to mention target sdk like
minSdkVersion 19
targetSdkVersion 21
versionCode 1
versionName "1.0"
in Manifest file OR in build.gradle file.
My build.gradle contains
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.everestek.login"
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

Abhishek
- 3,348
- 3
- 15
- 34
-
i installed latest studio and changed the target and compiled sdk versions to lollipop from marshmallow after these changes project is not working its showing these erorrs Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. – vijay b Feb 02 '16 at 10:14
-
You keep compileSdkVersion 23 buildToolsVersion "23.0.2" just change target sdk and try – Abhishek Feb 02 '16 at 10:16
0
Your compile SDK version must match the support library's major version.
Since you are using version 23 of the support library, you need to compile against version 23 of the Android SDK.
Alternatively you can continue compiling against version 22 of the Android SDK by switching to the latest support library v22.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.suhasbachewar.demo"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}

Suhas Bachewar
- 1,230
- 7
- 21
0
It will work perfectly.All you need to do is just change minSdkVersion
to 16
or any level you want to extend your support.Compile SDK version is for compiling using build tools.There will be no problem with it.You can Provide support to older devices.

SudheeR Bolla
- 171
- 2
- 12