I can't get the splash screen images to load? It flashes white, then goes black and after a few seconds the app loads. My config.xml is as follows:
I'm building using Cordova 5.0.0 targeting Android. I have ported my app over from PhoneGap where it builds successfully and splash screen works.
config.xml
<platform name="android">
<splash src="www/images/openingscenehdpi.png" density="hdpi"/>
<splash src="www/images/openingsceneldpi.png" density="ldpi"/>
<splash src="www/images/openingscenemdpi.png" density="mdpi"/>
<splash src="www/images/openingscenexhdpi.png" density="xhdpi"/>
<preference name="android-minSdkVersion" value="14"/>
<preference name="android-targetSdkVersion" value="19"/>
<preference name="SetFullscreen" value="true"/>
<preference name="orientation" value="landscape"/>
</platform>
After reading all the other similar problems I have unsuccessfully tried the following, all resulting in no change to app behaviour:
- Only having splash elements inside tags
- Adding preference name="SplashScreen" value="screen" inside and outside platform tags
- Adding preference name="SplashScreen" value="splash" inside and outside platform tags
- Adding files direct into folders found in platforms/android/res
- Adding spashscreen javscipt into index.html
I've followed the documentation and tried others advice, now I'm totally stumped..
Can anyone help ?
Fixed! Documentation is lacking, you must to install the Plugin:
cordova plugin add cordova-plugin-splashscreen
Have a res folder at the root of your project with the files in the correct folders (next to config.xml) and the following in your config.xml:
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="5000" />
<preference name="SplashMaintainAspectRatio" value="true|false" />
<platform name="android">
<splash src="res/drawable-hdpi/screen.png" density="hdpi"/>
<splash src="res/drawable-ldpi/screen.png" density="ldpi"/>
<splash src="res/drawable-mdpi/screen.png" density="mdpi"/>
<splash src="res/drawable-xhdpi/screen.png" density="xhdpi"/>
<splash src="res/drawable-xhdpi/screen.png" density="xxhdpi"/>
<splash src="res/drawable-xhdpi/screen.png" density="xxxhdpi"/>
</platform>
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