Reputation: 108
i try to add the splash screen plugin in the res/xml/config.xml file of my project.
This is what i want:
<?xml version='1.0' encoding='utf-8'?>
<widget id="fr.myname.firstapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0">
<name>FirstApp</name>
<description>
this is my first app
</description>
<author email="[email protected]" href="http://example.com">
My name
</author>
<content src="index.html" />
<access origin="*" subdomains="true" />
<preference name="loglevel" value="DEBUG" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="4000" />
<feature name="Notification">
<param name="android-package" value="org.apache.cordova.dialogs.Notification" />
</feature>
...
</widget>
After the build of the app with "cordova build android" command, the two lines i added have disappeared:
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="4000" />
What can cause that? i don't understand why it override my changes while i just followed official documentation.
Thanks for your help.
Upvotes: 1
Views: 2271
Reputation: 3183
I noticed this behavior as well and was pretty confused. For me, this happened when running ionic cordova run ios
command.
Apparently, this happens when I try to modify config.xml
file while this command is running. Looks like Cordova applies some local modifications to this file during the build, and then rollbacks the version of the file after you end that command. I noticed that whatever changes I make, they are reverted as soon as I press Ctrl + C
in the command line to end cordova process.
So in my case the solution was to stop currently running cordova process, edit config.xml
, save it and run cordova again. Hope this helps somebody searching for this issue.
Upvotes: 0
Reputation: 6029
The config.xml
plugin entries are only for use with the online Phonegap Build system.
If you are building locally, remove the feature tag from config.xml
and then use the CLI to install the plugin:
cordova plugin add org.apache.cordova.dialogs.Notification
cordova build android
Also, for the two lines that you do need in config.xml
, do not change in res/xml/config.xml
change in the project root config.xml
as every time you run the build
command the platform specific config.xml
is overwritten with the project level file.
Upvotes: 1