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.
The Android app must have a minimum SDK version 19 or higher.
The min sdk version is the earliest release of the Android SDK that your application can run on. Usually this is because of a problem with the earlier APIs, lacking functionality, or some other behavioural issue. The target sdk version is the version your application was targeted to run on.
Cordova Android is an Android application library that allows for Cordova-based projects to be built for the Android Platform. Cordova based applications are, at the core, applications written with web technology: HTML, CSS and JavaScript. Apache Cordova is a project of The Apache Software Foundation (ASF).
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 :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With