1

I'm developing an app for iOS and Android, I'm using Phonegap Build to create it. I want display Splash Screens, I have .png files created for each platform; in iOS everything works fine but in Android doesn't appears the Splash Screens.

My config.xml looks like this (relevant code):

<preference name="phonegap-version" value="3.4.0" />
<preference name="orientation" value="portrait" />

<gap:plugin name="org.apache.cordova.splashscreen" version="0.2.7" />

<!-- Android -->
<gap:splash src="screen/android/screen-ldpi-port.png" gap:platform="android" gap:qualifier="ldpi" />
<gap:splash src="screen/android/screen-mdpi-port.png" gap:platform="android" gap:qualifier="mdpi" />
<gap:splash src="screen/android/screen-hdpi-port.png" gap:platform="android" gap:qualifier="hdpi" />
<gap:splash src="screen/android/screen-xhdpi-port.png" gap:platform="android" gap:qualifier="xhdpi"/>

<!-- iOS -->
<gap:splash src="screen/ios/screen-iphone-portrait.png" gap:platform="ios" width="320" height="480" />
<gap:splash src="screen/ios/screen-iphone-portrait-2x.png" gap:platform="ios" width="640" height="960" />
<gap:splash src="screen/ios/screen-iphone-portrait-568h-2x.png" gap:platform="ios" width="640" height="1136" />
<gap:splash src="screen/ios/screen-ipad-portrait.png" gap:platform="ios" width="768" height="1024" />
<gap:splash src="screen/ios/screen-ipad-portrait-2x.png" gap:platform="ios" width="1536" height="2008" />

I follow the Phonegap Documentation to create my Splash Screens and the sizes for Android are:

  • screen-ldpi-port.png – (320 x 426)
  • screen-mdpi-port.png – (320 x 470)
  • screen-hdpi-port.png – (480 x 640)
  • screen-xhdpi-port.png – (720 x 960)

Any idea to solve it? Thanks!

1

2 Answers 2

3

You don't have the default splash tag which is

<gap:splash src="splash.png" />

It's in the documentation: http://docs.phonegap.com/phonegap-build/configuring/icons-and-splash/

You need to look at PhoneGap Build documentation, not just the PhoneGap documentation. Build is special.

2
  • For me have no make sense create a default splash screen if you are creating splash screens for all the OS that you're developing... But it fixed my problem, thanks a lot! Aug 2, 2014 at 19:11
  • Yes, it seems silly. The thing is the default screen covers all the possible screens you can have for Android so theoretically it's really useful for future proofing. iOS is pretty set and when iOS8 and iPhone6 come out they'll just add a new rule. Android is not so set so a new phone coming out next month might not fit the rules. Aug 2, 2014 at 23:17
0

You can also try this , its work for me

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

Similarly for other platform you can try

<platform name="ios">
    <icon height="57" platform="ios" src="www/res/icon/ios/icon.png" width="57" />
    <icon height="114" platform="ios" src="www/res/icon/ios/[email protected]" width="114" />
    <icon height="40" platform="ios" src="www/res/icon/ios/icon-40.png" width="40" />
    <icon height="80" platform="ios" src="www/res/icon/ios/[email protected]" width="80" />
    <icon height="50" platform="ios" src="www/res/icon/ios/icon-50.png" width="50" />
    <icon height="100" platform="ios" src="www/res/icon/ios/[email protected]" width="100" />
    <icon height="60" platform="ios" src="www/res/icon/ios/icon-60.png" width="60" />
    <icon height="120" platform="ios" src="www/res/icon/ios/[email protected]" width="120" />
    <icon height="180" platform="ios" src="www/res/icon/ios/[email protected]" width="180" />
    <icon height="72" platform="ios" src="www/res/icon/ios/icon-72.png" width="72" />
    <icon height="144" platform="ios" src="www/res/icon/ios/[email protected]" width="144" />
    <icon height="76" platform="ios" src="www/res/icon/ios/icon-76.png" width="76" />
    <icon height="152" platform="ios" src="www/res/icon/ios/[email protected]" width="152" />
    <icon height="29" platform="ios" src="www/res/icon/ios/icon-small.png" width="29" />
    <icon height="58" platform="ios" src="www/res/icon/ios/[email protected]" width="58" />
    <icon height="87" platform="ios" src="www/res/icon/ios/[email protected]" width="87" />
    <splash height="1136" platform="ios" src="www/res/screen/ios/Default-568h@2x~iphone.png" width="640" />
    <splash height="1334" platform="ios" src="www/res/screen/ios/Default-667h.png" width="750" />
    <splash height="2208" platform="ios" src="www/res/screen/ios/Default-736h.png" width="1242" />
    <splash height="1242" platform="ios" src="www/res/screen/ios/Default-Landscape-736h.png" width="2208" />
    <splash height="1536" platform="ios" src="www/res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" />
    <splash height="768" platform="ios" src="www/res/screen/ios/Default-Landscape~ipad.png" width="1024" />
    <splash height="2048" platform="ios" src="www/res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" />
    <splash height="1024" platform="ios" src="www/res/screen/ios/Default-Portrait~ipad.png" width="768" />
    <splash height="960" platform="ios" src="www/res/screen/ios/Default@2x~iphone.png" width="640" />
    <splash height="480" platform="ios" src="www/res/screen/ios/Default~iphone.png" width="320" />
</platform>
<platform name="wp8">
    <icon height="99" platform="wp8" src="www/res/icon/wp8/ApplicationIcon.png" width="99" />
    <icon height="159" platform="wp8" src="www/res/icon/wp8/Background.png" width="159" />
    <splash height="1280" platform="wp8" src="www/res/screen/wp8/screen-portrait.jpg" width="768" />
</platform>
<platform name="windows">
    <icon height="150" platform="windows" src="www/res/icon/windows/Square150x150Logo.scale-100.png" width="150" />
    <icon height="30" platform="windows" src="www/res/icon/windows/Square30x30Logo.scale-100.png" width="30" />
    <icon height="50" platform="windows" src="www/res/icon/windows/StoreLogo.scale-100.png" width="50" />
    <splash height="300" platform="windows" src="www/res/screen/windows/SplashScreen.scale-100.png" width="620" />
    <icon height="120" platform="windows" src="www/res/icon/windows/StoreLogo.scale-240.png" width="120" />
    <icon height="44" platform="windows" src="www/res/icon/windows/Square44x44Logo.scale-100.png" width="44" />
    <icon height="106" platform="windows" src="www/res/icon/windows/Square44x44Logo.scale-240.png" width="106" />
    <icon height="70" platform="windows" src="www/res/icon/windows/Square70x70Logo.scale-100.png" width="70" />
    <icon height="71" platform="windows" src="www/res/icon/windows/Square71x71Logo.scale-100.png" width="71" />
    <icon height="170" platform="windows" src="www/res/icon/windows/Square71x71Logo.scale-240.png" width="170" />
    <icon height="360" platform="windows" src="www/res/icon/windows/Square150x150Logo.scale-240.png" width="360" />
    <icon height="310" platform="windows" src="www/res/icon/windows/Square310x310Logo.scale-100.png" width="310" />
    <icon height="150" platform="windows" src="www/res/icon/windows/Wide310x150Logo.scale-100.png" width="310" />
    <icon height="360" platform="windows" src="www/res/icon/windows/Wide310x150Logo.scale-240.png" width="744" />
    <splash height="1920" platform="windows" src="www/res/screen/windows/SplashScreenPhone.scale-240.png" width="1152" />
</platform>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.