I have generated an application which runs very well on systems with api levels greater than 20, I wanted to try it with an android s4 mini which has an api level 19 (Kit-Kat) can someone help me to provide compatibility with this system.
I have gone through some tutorials which led me to modify the project structure and modify the compilesdk to version 19. But I have a problem with these two lines of gradle code
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
I tried changing the first dependency to its version 19.4.0, that is:
compile 'com.android.support:appcompat-v7:19.4.0'
and I have no problems but I can't do the same with the second dependency. Can anybody help me. The application works with the navigation drawer component
This is my full gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.example.kevtho.aplicacion"
minSdkVersion 19
targetSdkVersion 19
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile 'com.android.support:appcompat-v7:19.4.0'
compile 'com.android.support:design:23.4.0'
compile('com.android.support:support-v4:23.4.0') {
exclude group: 'com.android.support', module: 'support-v4'
}
compile 'com.google.android.gms:play-services:9.4.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support:support-v4:23.2.1'
compile files('libs/btsdk.jar')
compile files('libs/gson-2.2.4.jar')
//compile files('libs/android-support-4.0.jar')
}
You don't need to change the dependencies:
if you want your app to be supported for Android API 19 devices simply define :
and don't change
compileSdkVersion
andbuildToolsVersion
you can use a version according to the dependencies you have definedthe same for
targetSdkVersion
:If I'm not mistaken, what limits the ability to run the app is the
minSdkVersion=19
onecompileSdkVersion
you indicate with which SDK you want to compile the project.I guess the second dependency you're referring to
com.android.support:dessign:23...
is the normal one that you can't set to 19, since it didn't exist then, Google removed it to provide compatibility with the Lollipop API for earlier versions.I was able to solve the problem, it turns out that the compatibility problem was due to the fact that I use multidex in my project, the solution was to add dependencies of this class to the project grade. Here I share the detailed information.
https://developer.android.com/studio/build/multidex.html