Compatibility of api 22 with api 19

1

I generated an application which runs very well on systems with api levels higher than 20, I wanted to try an android s4 mini which has an api level 19 (Kit-Kat) someone can help me to give compatibility with this system.

I have reviewed some tutorials which led me to modify the project structure and modify 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'

Try changing the first dependency to your verion 19.4.0 ie:

compile 'com.android.support:appcompat-v7:19.4.0'

and I have no problems but I can not do the same with the second dependcia. Can anybody help me. The application works with the navigation drawer component

This is my complete 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')
}
    
asked by Kevtho 28.11.2016 в 16:54
source

3 answers

0

I could already solve the problem, it turns out that the compatibility problem occurred because in my project I use multidex, the solution was to add dependencies of this class to the project's grade. Here I share the detailed information.

link

    
answered by 30.11.2016 / 02:55
source
1

You do not need to change the dependencies:

compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'

If you want your application to be supported for devices with Android API 19 simply define:

 minSdkVersion 19

and do not change compileSdkVersion and buildToolsVersion you can use a version according to the dependencies that you have defined

android {
compileSdkVersion 24
buildToolsVersion "23.0.3"

the same for targetSdkVersion :

targetSdkVersion 23
    
answered by 28.11.2016 в 21:06
0

If I'm not going wrong, what limits the app can run is the minSdkVersion=19 the compileSdkVersion you indicate with which SDK you want to compile the project.

I suppose that the second dependency that you refer is to the com.android.support:dessign:23... is normal that you can not put it to 19, since it did not exist then, Google the sac to give compatibility to the API of Lollipop for previous versions.

    
answered by 28.11.2016 в 17:04