Search code examples
androidcordovaphonegap-buildsplash-screen

Phonegap Android splash screen not showing


I'm building a iOS and Android app (with ionic framework and Adobe Phonegap Build), but can't seem to get the splash screens showing up in Android here's my config.xml:

<gap:plugin name="org.apache.cordova.splashscreen" version="0.3.4" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="true" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="1000" />

<gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="icons/splashscreen/port-ldpi.png" />
<gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="icons/splashscreen/port-mdpi.png" />
<gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="icons/splashscreen/port-hdpi.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="icons/splashscreen/port-xhdpi.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xxhdpi" src="icons/splashscreen/port-xxhdpi.png" />

The splash screen images are sizes like this:

port-ldpi.png = 240x320
port-mdpi.png = 320x480
port-hdpi.png = 480x800
port-xhdpi.png = 720x1280
port-xxhdpi.png = 1280x1920

The path to the images are correct. On iOS it working without any problems.

Any suggestions how to solve this problem? :S


Solution

  • You can look at my example demos. https://github.com/jessemonroy650/Phonegap-Splashscreen-Test It works for both Android and iOS. Implemenation notes are included. NOTE: AndroidManifest.xml is NOT needed.

    Also the splash image MUST be the correct size or at least the correct size ratio so it can stretch it. Example:320x240 will work for 640x480, etc. Otherwise, you need to use a 9-patch image. I have not tested 9-patch.