I've set a minSdkVersion to 8 in www/config.xml :
<preference name="android-minSdkVersion" value="8" />
<preference name="android-installLocation" value="auto" />
When I run "phonegap local build android", the following files are generated :
find /Users/alain/Documents/projects/pg33_3/platforms/android -type d \( -name RCS -o -name CVS -o -name .svn -o -name SCCS \) -prune -o -type f \! -name \*\~ \! -name \*\,v \! -name s.\* \! -name .\#\* -print0 | xargs -0 grep -n -e minSdkVersion /dev/null
/Users/alain/Documents/projects/pg33_3/platforms/android/AndroidManifest.xml:13: <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
/Users/alain/Documents/projects/pg33_3/platforms/android/assets/www/config.xml:26: <preference name="android-minSdkVersion" value="8" />
/Users/alain/Documents/projects/pg33_3/platforms/android/bin/AndroidManifest.xml:13: <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />/Users/alain/Documents/projects/pg33_3/platforms/android/CordovaLib/AndroidManifest.xml:22: <uses-sdk android:minSdkVersion="8" />
/Users/alain/Documents/projects/pg33_3/platforms/android/CordovaLib/bin/AndroidManifest.xml:22: <uses-sdk android:minSdkVersion="8" />
/Users/alain/Documents/projects/pg33_3/platforms/android/res/xml/config.xml:53: <preference name="android-minSdkVersion" value="8" />
So why does it suddenly become minSdkVersion=10 in AndroidManifest.xml and bin/AndroidManifest.xml ?
Here is my config.xml file :
<?xml version='1.0' encoding='utf-8'?>
<widget id="it.myapp.MyApp" version="1.5.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>MyApp</name>
<description>
My App
</description>
<author email="[email protected]" href="http://myapp.it">
MyApp Team
</author>
<feature name="http://api.phonegap.com/1.0/device" />
<preference name="permissions" value="none" />
<preference name="orientation" value="portrait" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="8" />
<preference name="android-installLocation" value="auto" />
<icon src="icon.png" />
<icon gap:density="ldpi" gap:platform="android" src="res/icon/android/icon-36-ldpi.png" />
<icon gap:density="mdpi" gap:platform="android" src="res/icon/android/icon-48-mdpi.png" />
<icon gap:density="hdpi" gap:platform="android" src="res/icon/android/icon-72-hdpi.png" />
<icon gap:density="xhdpi" gap:platform="android" src="res/icon/android/icon-96-xhdpi.png" />
<icon gap:platform="blackberry" src="res/icon/blackberry/icon-80.png" />
<icon gap:platform="blackberry" gap:state="hover" src="res/icon/blackberry/icon-80.png" />
<icon gap:platform="ios" height="57" src="res/icon/ios/icon-57.png" width="57" />
<icon gap:platform="ios" height="72" src="res/icon/ios/icon-72.png" width="72" />
<icon gap:platform="ios" height="114" src="res/icon/ios/icon-57-2x.png" width="114" />
<icon gap:platform="ios" height="144" src="res/icon/ios/icon-72-2x.png" width="144" />
<icon gap:platform="webos" src="res/icon/webos/icon-64.png" />
<icon gap:platform="winphone" src="res/icon/windows-phone/icon-48.png" />
<icon gap:platform="winphone" gap:role="background" src="res/icon/windows-phone/icon-173.png" />
<gap:splash gap:density="ldpi" gap:platform="android" src="res/screen/android/screen-ldpi-portrait.png" />
<gap:splash gap:density="mdpi" gap:platform="android" src="res/screen/android/screen-mdpi-portrait.png" />
<gap:splash gap:density="hdpi" gap:platform="android" src="res/screen/android/screen-hdpi-portrait.png" />
<gap:splash gap:density="xhdpi" gap:platform="android" src="res/screen/android/screen-xhdpi-portrait.png" />
<gap:splash gap:platform="blackberry" src="res/screen/blackberry/screen-225.png" />
<gap:splash gap:platform="ios" height="480" src="res/screen/ios/screen-iphone-portrait.png" width="320" />
<gap:splash gap:platform="ios" height="960" src="res/screen/ios/screen-iphone-portrait-2x.png" width="640" />
<gap:splash gap:platform="ios" height="1024" src="res/screen/ios/screen-ipad-portrait.png" width="768" />
<gap:splash gap:platform="ios" height="768" src="res/screen/ios/screen-ipad-landscape.png" width="1024" />
<gap:splash gap:platform="winphone" src="res/screen/windows-phone/screen-portrait.jpg" />
<gap:plugin name="org.apache.cordova.splashscreen" />
<access origin="http://127.0.0.1*" />
</widget>
Unfortunately it seems that many of the settings in the config.xml are only used by the Phonegap Build service and get ignored when adding local platforms.
I had the same problem, the only solution I've found is to create a copy of the AndroidManifest.xml and make your changes to it -- then add a hook in the .cordova/hooks folder to copy your custom file and overwrite the default one provided by cordova.
You'll probably need this in the long run anyway as you want to customize Android settings that aren't represented in the phonegap config.xml file.
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