Android-runtime: Setting minSdkVersion in AndroidManifest.xml is not respected in build.gradle

Created on 4 Oct 2016  路  2Comments  路  Source: NativeScript/android-runtime

Setting minSdkVersion in AndroidManifest.xml is not respected in build.gradle as a result the app published in google store can be installed on lower versions.

Steps to reproduce:
Create an ap with different minSDKversion then the default
in _app/App_Resources/Android/AndroidManifest.xml_

android:minSdkVersion="19"

Building you app will result that in

_platforms/android/src/main/AndroidManifest.xml_ the android:minSdkVersion is 19
however in buld.gradle the version is still 17

    defaultConfig {
        minSdkVersion 17
        targetSdkVersion computeTargetSdkVersion()
    }

related to http://stackoverflow.com/questions/39843611/set-the-supported-lowest-supported-android-version-in-a-nativescript-app

question

Most helpful comment

Hi @spstratis,
what you can do is go to app/App_Resources/Android/app.gradle and change the default configuration to meet your requirements.

android {  
  defaultConfig {  
    minSdkVersion 19
....

Gradle overrides the AndroidManifest.xml that's why you need to change the configuration in gradle, rather than in the manifest file.

All 2 comments

+1 this is a pretty big problem for me right now. Would manually updating the gradle some how fix it?

Hi @spstratis,
what you can do is go to app/App_Resources/Android/app.gradle and change the default configuration to meet your requirements.

android {  
  defaultConfig {  
    minSdkVersion 19
....

Gradle overrides the AndroidManifest.xml that's why you need to change the configuration in gradle, rather than in the manifest file.

Was this page helpful?
0 / 5 - 0 ratings