splash screen on android not working

  • 1
  • Problem
  • Updated 4 years ago

<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.phonegap.Mobile App" version="1.0.0">
<name>Rocket Scripts</name>
<description>Mobile App</description>
<author href="http://phonegap.com" email="support@phonegap.com">PhoneGap Team</author>
<content src="index.html"/>
<preference name="permissions" value="none"/>
<preference name="orientation" value="default"/>
<preference name="target-device" value="universal"/>
<preference name="fullscreen" value="false"/>
<preference name="webviewbounce" value="false"/>
<preference name="prerendered-icon" value="true"/>
<preference name="stay-in-webview" value="false"/>
<preference name="ios-statusbarstyle" value="black-opaque"/>
<preference name="StatusBarStyle" value="lightcontent" />
<preference name="StatusBarBackgroundColor" value="#28a094" />
<preference name="detect-data-types" value="true"/>
<preference name="exit-on-suspend" value="false"/>
<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="10000"/>
<preference name="disable-cursor" value="false"/>
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="android-minSdkVersion" value="14"/>
<preference name="android-installLocation" value="auto"/>
<gap:plugin name="org.apache.cordova.battery-status"/>
<gap:plugin name="org.apache.cordova.camera"/>
<gap:plugin name="org.apache.cordova.media-capture"/>
<gap:plugin name="org.apache.cordova.console"/>
<gap:plugin name="org.apache.cordova.contacts"/>
<gap:plugin name="org.apache.cordova.device"/>
<gap:plugin name="org.apache.cordova.device-motion"/>
<gap:plugin name="org.apache.cordova.device-orientation"/>
<gap:plugin name="org.apache.cordova.dialogs"/>
<gap:plugin name="org.apache.cordova.file"/>
<gap:plugin name="org.apache.cordova.file-transfer"/>
<gap:plugin name="org.apache.cordova.geolocation"/>
<gap:plugin name="org.apache.cordova.globalization"/>
<gap:plugin name="org.apache.cordova.inappbrowser"/>
<gap:plugin name="org.apache.cordova.media"/>
<gap:plugin name="org.apache.cordova.network-information"/>
<gap:plugin name="org.apache.cordova.splashscreen"/>
<gap:plugin name="org.apache.cordova.vibration"/>
<icon src="icon.png"/>
<gap:splash src="splash.png" />
<icon src="www/res/icon/android/icon-36-ldpi.png" gap:platform="android" gap:qualifier="ldpi"/>
<icon src="www/res/icon/android/icon-48-mdpi.png" gap:platform="android" gap:qualifier="mdpi"/>
<icon src="www/res/icon/android/icon-72-hdpi.png" gap:platform="android" gap:qualifier="hdpi"/>
<icon src="www/res/icon/android/icon-96-xhdpi.png" gap:platform="android" gap:qualifier="xhdpi"/>
<icon src="www/res/icon/blackberry/icon-80.png" gap:platform="blackberry"/>
<icon src="www/res/icon/blackberry/icon-80.png" gap:platform="blackberry" gap:state="hover"/>
<icon src="/res/icon/ios/icon-57.png" gap:platform="ios" width="57" height="57"/>
<icon src="/res/icon/ios/icon-72.png" gap:platform="ios" width="72" height="72"/>
<icon src="/res/icon/ios/icon-57-2x.png" gap:platform="ios" width="114" height="114"/>
<icon src="/res/icon/ios/icon-72-2x.png" gap:platform="ios" width="144" height="144"/>
<icon src="www/res/icon/webos/icon-64.png" gap:platform="webos"/>
<icon src="www/res/icon/windows-phone/icon-48.png" gap:platform="winphone"/>
<icon src="www/res/icon/windows-phone/icon-173-tile.png" gap:platform="winphone" gap:role="background"/>
<gap:splash src="www/res/screen/android/screen-ldpi-portrait.png" gap:platform="android" gap:qualifier="port-ldpi"/>
<gap:splash src="www/res/screen/android/screen-mdpi-portrait.png" gap:platform="android" gap:qualifier="port-mdpi"/>
<gap:splash src="www/res/screen/android/screen-hdpi-portrait.png" gap:platform="android" gap:qualifier="port-hdpi"/>
<gap:splash src="www/res/screen/android/screen-xhdpi-portrait.png" gap:platform="android" gap:qualifier="port-xhdpi"/>
<gap:splash src="www/res/screen/android/screen-xxhdpi-portrait.png" gap:platform="android" gap:qualifier="port-xxhdpi" />
<gap:splash src="www/res/screen/blackberry/screen-225.png" gap:platform="blackberry"/>
<gap:splash src="/res/screen/ios/screen-iphone-750x1334.png" gap:platform="ios" width="750" height="1334" />
<gap:splash src="/res/screen/ios/screen-iphone-1242x2208.png" gap:platform="ios" width="1242" height="2208" />
<gap:splash src="/res/screen/ios/screen-iphone-2208x1242.png" gap:platform="ios" width="2208" height="1242" />
<gap:splash src="/res/screen/ios/screen-iphone-portrait.png" gap:platform="ios" width="320" height="480"/>
<gap:splash src="/res/screen/ios/screen-iphone-portrait-2x.png" gap:platform="ios" width="640" height="960"/>
<gap:splash src="/res/screen/ios/screen-iphone-portrait-568h-2x.png" gap:platform="ios" width="640" height="1136"/>
<gap:splash src="/res/screen/ios/screen-ipad-portrait.png" gap:platform="ios" width="768" height="1024"/>
<gap:splash src="/res/screen/ios/screen-ipad-landscape.png" gap:platform="ios" width="1024" height="768"/>
<gap:splash src="www/res/screen/windows-phone/screen-portrait.jpg" gap:platform="winphone"/>
<access origin="*" />
<access origin="tel:*" launch-external="yes" />
<access origin="geo:*" launch-external="yes" />
<plugin name="cordova-plugin-whitelist" version="1"/>
<plugin name="com.phonegap.plugin.statusbar" spec="1.1.0" source="pgb" />
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
<allow-intent href="market:*"/>
</platform>
<platform name="ios">
<allow-intent href="itms:*"/>
<allow-intent href="itms-apps:*"/>
</platform>
</widget>

Photo of kapil jain

kapil jain

  • 39 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 1
Photo of kapil jain

kapil jain

  • 39 Posts
  • 0 Reply Likes
I have posted my config and location of images in my project as well, I have been trying for hours but not able to get the splash screen working on android, it works fine on ios.
Photo of kapil jain

kapil jain

  • 39 Posts
  • 0 Reply Likes
i also deleted and nothing changed. i still get a blank white page instead of the splash screen.
Photo of Chris Griffith

Chris Griffith, Champion

  • 347 Posts
  • 92 Reply Likes
Your path is incorrect to your splash screens. Remove the www/ from the references. The config.xml is within the www folder.

Chris
Photo of kapil jain

kapil jain

  • 39 Posts
  • 0 Reply Likes
i tried that but the issue is still there...
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Chris,
be aware that some people are using CLI or Phonegap Desktop App to build the framework. As such, this will be a continuous error to be aware of.

Personally, I inform people that the must abandon PDA to make a real app. If they are using CLI, I advise they do not use Phonegap Build.

Best of Luck
Jesse
Photo of kapil jain

kapil jain

  • 39 Posts
  • 0 Reply Likes
can some one plz help me out with this issue..
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@kapil
Since this is your first post, please answer the following question.
- Is this your first hybrid App?
- Are you using the Desktop App?
- What is your target device/platform and their target versions: Android 4,5,6? iOS 7,8,9?
- Are you using CLI, SDK or Build? Please do not assume the answer, please read the link.

Jesse
Photo of kapil jain

kapil jain

  • 39 Posts
  • 0 Reply Likes
1. Yes this is my first hybrid app.
2. No.
3. ios 9 and android latest version.
4. I am using the build.
Photo of kapil jain

kapil jain

  • 39 Posts
  • 0 Reply Likes
i was able to fix this after adding
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@kapil,
What did you fix? What did you add?
Your answer will help future developers.
Jesse
Photo of kapil jain

kapil jain

  • 39 Posts
  • 0 Reply Likes
Hi i was able to fix the issue by adding


<preference name="SplashScreen" value="splash" />
Photo of kapil jain

kapil jain

  • 39 Posts
  • 0 Reply Likes
my image names were not splash.png i had custom images per screen size ,It is really strange because without the preference the splashscreen dont not work. I think that in my case, by giving the value of "splash" it understand to take all the values from "gap:splash src=""...
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Obviously, this preference does not conform to its own documentation. Instead, it looks as if a value of "splash" or "screen" is required even though there is no splash.png or screen.png present

Also, it is quite unclear why anyone would need to set this preference. What does it do? Define a "default splashscreen"? Why? With exception of a 9-patch png for Android, there can't be such thing as a 'default splash', for instance because iOS requires several splashes of exactly defined dimensions.
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Petra,
I looked into this - as we have seen issues with icons and splashscreens many times before. I look at the documentation for 'Build' and 'Cordova'

- Build Splash Screns
- Build Preferences
- Cordova Splash Screens It says: Support for splash screen has moved to a Cordova plugin of its own.
- Cordova Preferences See preference - nothing about splash screens here
- The answer is in the plugin documentation.
- Plugin Splash Screen See Andrid Quirks

On this, it is not clear to me why this is needed and how it works. In addition, I tried to write some notes explaining this, but the mess only became bigger over time. The notes are dated, but it gave me a hint as to where I should look. Yes, the document is entitled: preference-mess.md