How can I specify the minimum SDK in phonegap? It is ignoring android-minsdkversion in config.xml
This is a phonegap 3.5 / cordova 3 android app. In www/config.xml I have:
<preference name="android-minSdkVersion" value="19">
<preference name="android-targetSdkVersion" value="19">
However, when I build it, it creates an AndroidManifest.xml with:
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
The result is that people with SDK versions below 19 can install my app from the store. Where is it getting that 10 from and how can I change it? Due to weirdness with Viewport, my app's behavior is suspect on OSes below 4.4 and I am already getting 1-star reviews from 4.2.2 users.
With older version of cordova CLI, I used to modify manually AndroidManifest.xml
to change a few settings (launch mode, minsdk...) like you do in your answer.
And with Cordova 3.5.something things started to go wrong, and some changes were lost each time I built the project.
Now I added those lines in config.xml
and the settings are updated automatically :
<platform name="android">
<preference name="AndroidLaunchMode" value="singleTop"/>
<preference name="android-minSdkVersion" value="14" />
<icon src="res/android/xhdpi.png" />
<icon src="res/android/ldpi.png" density="ldpi" />
<icon src="res/android/mdpi.png" density="mdpi" />
<icon src="res/android/hdpi.png" density="hdpi" />
<icon src="res/android/xhdpi.png" density="xhdpi" />
</platform>
The advantage is that I can now delete the android platform and recreate it without loosing any setting.
As Phonegap is being updated to be inline with cordova, preferences in config.xml
should work with the new version, and maybe you will see your manual updated be lost like it happened to me...
STEP 1) yourapp/config.xml file <platform name="android">
tags add two preference
<platform name="android">
<preference name="android-minSdkVersion" value="14" />
<preference name="android-targetSdkVersion" value="19" />
</platform>
STEP 2) cordova platform rm android
run cmd code
STEP 3) cordova platform add android
run cmd code
Check your AndroidManifest.xml file if look like below
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
every thing is OKAY :)