Splashscreen doesn't show up. Black screen for 2 seconds

Hej,
I have a problem with getting splashscreen to work with the latest cordova/ionic. My test case:

  • ionic start screentestapp blank
  • cordova add android
  • cd screentestapp
  • mkdir resources
  • place splash.psd into resources
  • ionic resources --splash
  • cordova build android
  • Test it on a physical device

The result I get is a black/brown splashscreen for 2 seconds, then the white flash and my app starts.


Disclaimer:

  • This is more or less my 5th cordova/ioinic app so I’m no newbie :stuck_out_tongue :stuck_out_tongue:
  • I have my <preference name="SplashScreenDelay" value="2000"/> and <preference name="SplashScreen" value="screen"/> configured
  • I’ve tried different versions of the cordova-plugin-splashscreen, I’ve tried both the direct and indirect link (github) option,
  • I’ve tested it on 2 physical devices (android 4.x and 5.x),
  • I’ve tried to use 2 different psd (one from my previous project which worked.
  • The splashscreens are generated,
  • I’ve tried removing/adding plugins/platforms etc.
  • I’ve tried to start the splashscreen from app.js through $cordovaSplashscreen.show(); and/or navigator.splashscreen.show();
  • … and a bunch of other crazy things.

Any ideas?

I don’t think you need to add the ‘resource’ folder by yourself.

All you have to do is build the project and ionic will automatically add the required plugins. Do this and you should see the default ionic splashscreen:

ionic start screentest blank
cd screentest
ionic platforms add android

Look at the command prompt and you will see this:

Installing “cordova-plugin-splashscreen” for android

This means that ionic has successfully installed the splashscreen to your project. Now, go to your project directory and go to ‘config.xml.’ You will see this xml lines:

<platform name="android">
    <icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/>
    <icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi"/>
    <icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi"/>
    <icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi"/>
    <icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi"/>
    <icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
    <splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi"/>
    <splash src="resources/android/splash/drawable-land-mdpi-screen.png" density="land-mdpi"/>
    <splash src="resources/android/splash/drawable-land-hdpi-screen.png" density="land-hdpi"/>
    <splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
    <splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
    <splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
    <splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/>
    <splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi"/>
    <splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi"/>
    <splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
    <splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
    <splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
  </platform>

Go to the ‘resource’ folder (which was created automatically by ionic when you ran the ‘platforms add’) and you will see the splashscreen images

Hmm, no use, I still get the same result. The splashscreens are generated and so does the xml configuration, but I still get the same result. Does this work for you? If so what version of cordova/ionic are you using?

I use:
cordova --version
6.0.0
ionic --version
1.6.5

EDIT 14/07/2016
I’ve updated my ionic and cordova and now it works. This is strange since my other apps work with the older versions. Thanks anyway!

My current versions are:
cordova --version
6.2.0
ionic --version
1.7.16