Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Cordova splash screens not showing in Android

I am running Apache Cordova 3.6.3-0.2.13. And I try to get the splash screens working. I have followed the documentation on http://cordova.apache.org/docs/en/3.6.0/config_ref_images.md.html#Icons%20and%20Splash%20Screens. And the icons are working, but no success for the splash screens. We are also using the Ionic framework (version 1.2.8) on top of Cordova.

What I have done:

Added icons and splash screens to config.xml from the project root:

<preference name="SplashScreen" value="splash"/> <preference name="SplashScreenDelay" value="10000"/> <platform name="android">   <icon src="icons/icon.png"/>    <!-- you can use any density that exists in the Android project -->   <splash src="icons/android-splash-land-hdpi.png" density="land-hdpi"/>   <splash src="icons/android-splash-land-ldpi.png" density="land-ldpi"/>   <splash src="icons/android-splash-land-mdpi.png" density="land-mdpi"/>   <splash src="icons/android-splash-land-xhdpi.png" density="land-xhdpi"/>    <splash src="icons/android-splash-port-hdpi.png" density="port-hdpi"/>   <splash src="icons/android-splash-port-ldpi.png" density="port-ldpi"/>   <splash src="icons/android-splash-port-mdpi.png" density="port-mdpi"/>   <splash src="icons/android-splash-port-xhdpi.png" density="port-xhdpi"/> </platform> 

Ofcourse the icons directory exists and also the files are in place. When I build the project with ionic run android or cordova run android. The build process also creates the icons and splash screens into the platforms/android/res/drawable directory!

Also the config file located at platforms/android/res/xml/config.xml is correctly updated and the <preference> and <icon> and <splash> elements are in place.

I also tried with the org.apache.cordova.splashscreen plugin and also no success. I have added the plugin with ionic plugin add org.apache.cordova.splashscreen and also added onDeviceReady the code navigator.splashscreen.show();. But this also shows nothing.

What am I missing here?

like image 373
Mark Veenstra Avatar asked Oct 17 '14 14:10

Mark Veenstra


People also ask

How do you add a splash screen in ionic 5?

By adding a platform, Ionic will install Cordova splash screen plugin for that platform so we do not need to install anything afterwards. All we need to do is to find two images. The images should be png, psd or ai files. The minimum dimension should be 192x192 for icon image and 2208×2208 for the splash screen image.


1 Answers

Just had this problem myself. Change this

<preference name="SplashScreen" value="splash"/> 

to

<preference name="SplashScreen" value="screen"/> 

This fixed it.

source: http://forum.ionicframework.com/t/need-help-with-displaying-splash-screen-on-android-cordova-3-6/10436/12

like image 79
Filipe Silva Avatar answered Oct 06 '22 07:10

Filipe Silva