Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cordova build setting cdvMinSdkVersion

I am attempting to build an Android APK using the following command:

cordova build android --release -- --gradleArg=-PcdvMinSdkVersion=19

Yet when I verify which minSdkVersion the built APK targets, I am informed it's version 15 (0xf):

aapt list -a android-release.apk | grep SdkVersion

Why is the first command not working?

I am NOT using Crosswalk (looking at build.gradle, this should not matter anyway).

like image 346
keldar Avatar asked Aug 25 '16 10:08

keldar


2 Answers

I have found the answer - I am using the plugin phonegap-plugin-barcodescanner which explicitly sets the minSdkVersion in its own build.gradle file:

ext.cdvMinSdkVersion=15

Is the very first line.

like image 179
keldar Avatar answered Oct 16 '22 00:10

keldar


In my case the same problem was fixed by adding the following setting in the config.xml file:

<preference name="android-minSdkVersion" value="19" />

You may use whatever android SDK version as a minimum as you wish.

like image 29
Lentyai Avatar answered Oct 16 '22 00:10

Lentyai