white screen after splash screen phonegap ios

3,649 views
Skip to first unread message

Wissam Abdo

unread,
Jun 6, 2014, 3:29:22 AM6/6/14
to phon...@googlegroups.com

I'm using PhoneGap local build, attempting to get rid of the blank white screen that appears after the splash screen on ios.

 None of the things I've tried have worked--mainly, nothing worked !


please help

Ben Atack

unread,
Jun 6, 2014, 3:50:31 AM6/6/14
to phon...@googlegroups.com
I had a similar issue.

Check that your splash screen files are in the correct directory - that they match your config.xml.

Revert splash screen to version 0.2.3 in your config.xml file.

Phonegap build has just updated to 3.4. This could also be the issue.

Good luck.

Steve Husting

unread,
Jun 6, 2014, 2:46:42 PM6/6/14
to phon...@googlegroups.com
I'm having the same problem, but with Android. After adding the splash screens, I get a white screen after the splash screen upon initial load. But when I shut it down and start it with the icon, the splash screen shows, then ends in a white screen, and doesn't enter the app at all.

I removed all information about the splash screens from the app. No splash screen, but no app either - screen is still white!

Sorry I did not use Git for this project :(

Steve Husting

unread,
Jun 6, 2014, 3:57:17 PM6/6/14
to phon...@googlegroups.com
Try this. It stills shows the white screen, but at least it goes to the app afterward:

    function onDeviceReady() {
        // Now safe to use device APIs
        // navigator.splashscreen.show();
        navigator.splashscreen.hide();
    }

From:

Steve H

Steve Husting

unread,
Jun 6, 2014, 4:03:35 PM6/6/14
to phon...@googlegroups.com
Try: Remove the plugin and install it again --

cordova plugin rm org.apache.cordova.splashscreen

cordova plugin add org.apache.cordova.splashscreen


On Friday, June 6, 2014 12:29:22 AM UTC-7, Wissam Abdo wrote:

Steve Husting

unread,
Jun 6, 2014, 5:20:45 PM6/6/14
to phon...@googlegroups.com
These are the steps I followed. Am I missing something? Problem, White screen seen after splashscreen, and doesn't proceed to app.

Setting up the Splashscreen API:

1. In console:
cordova plugin add org.apache.cordova.splashscreen

2. In index.html:
    function onLoad() {
        document.addEventListener("deviceready", onDeviceReady, false);
    }

    // device APIs are available

    function onDeviceReady() {
        // Now safe to use device APIs
        navigator.splashscreen.show();
    }
    
3. In config.xml:
<preference name="splashscreen" value="splash" /> <!-- Assumes your splash images in res/drawable/ are named "splash.png" -->
<feature name="SplashScreen">
    <param name="android-package" value="org.apache.cordova.SplashScreen" />
</feature>

4. In ProjectName.java:
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl(Config.getStartUrl(), 2000);

My development environment:

Mac OS X 10.9.1 on latest Mac Mini
Cordova CLI 3.4.0
for Android 4.3, 4.4 v19
ADT v22.0.1 with Eclipse platform (not using Eclipse at this time)
Testing in device: Android-19, Nexus 7 2012 with 4.3 Jelly Bean ("cordova build")
Not for PG Build; no Jquery or other JS or CSS packages used

Steve Husting

unread,
Jun 6, 2014, 6:11:59 PM6/6/14
to phon...@googlegroups.com
I changed ...
navigator.splashscreen.show();
... to ...
navigator.splashscreen.hide();

Much better! You want the splashscreen to stop when the program is starting up. 

Wissam Abdo

unread,
Jun 11, 2014, 8:05:00 AM6/11/14
to phon...@googlegroups.com
i' using splashcreen plugin 0.3.0 
how can i rever to 0.2.7 ?
only in my config.xml?
cause i did that and nothing change on ios !

Ben Atack

unread,
Jun 11, 2014, 8:36:32 AM6/11/14
to phon...@googlegroups.com
try version 0.2.3
for config.xml:
<gap:plugin name="org.apache.cordova.splashscreen" version="0.2.3" />

Ben Atack

unread,
Jun 11, 2014, 9:44:50 AM6/11/14
to phon...@googlegroups.com
Please describe your issue in more depth.

Steve Husting

unread,
Jun 11, 2014, 12:09:36 PM6/11/14
to phon...@googlegroups.com
I'm still getting a white screen, even with splashscreen.hide. Also, the alert does not fire: 

    function onDeviceReady() {
        // Now safe to use device APIs
        alert('onDeviceReady now firing');
        navigator.splashscreen.hide();

Something is wrong other than the splashscreen code. I haven't read anything that contradicts the way I loaded it. 

Steve Husting

unread,
Jun 11, 2014, 2:47:17 PM6/11/14
to phon...@googlegroups.com
Here is my entire index.html file. Three alerts fire on install, and only one fires on apps's icon-tap. At install, app successfully goes to correct home screen of app. On app icon-tap, onDeviceReady does not fire and it freezes at white screen. Splash screen shows briefly at install and icon-tap. 

So something is happening to the app between shutting down the first-install version and icon-tap start version.

All the page does is determine screen width and switch to the large-scale wallpaper home page or the small-scale wallpaper home page. 

My index.html:

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
    // Wait for device API libraries to load
        document.addEventListener("deviceready", onDeviceReady, false);

    // device APIs are available
    function onDeviceReady() {
alert('Fires 2nd only at install. Not firing at icon-tap and freezes at white screen.');
}

</script>
</head>
<body>

<p>&nbsp;</p>

<!-- Android -->
<script type="text/javascript">
alert('Fires 1st at install and icon-tap.');

setTimeout(switcher, 3000);

function switcher() {
if (screen.width <= 640) { // images are in app
navigator.splashscreen.hide();
document.location = "iphone/index.html";
}
if (screen.width > 640) { // larger images are downloaded from server
navigator.splashscreen.hide();
alert('Fires 3rd only at install and goes to app home page. Not firing at icon-tap and freezes at white screen.');
document.location = "ipad/index.html";
}
}

</script>
</body>
</html>

My development environment:

Mac OS X 10.9.3 on latest Mac Mini
Cordova CLI 3.4.0
for Android 4.3, 4.4 v19
ADT v22.0.1 with Eclipse platform (not using Eclipse at this time)
Testing in device: Android-19, Nexus 7 2012 with 4.3 Jelly Bean ("cordova build")
Not for PG Build; using JQuery after the index.html page

Ben Atack

unread,
Jun 12, 2014, 5:45:17 AM6/12/14
to phon...@googlegroups.com
You should probably ask your question here: 

You don't use navigator.splashscreen.hide(); for android. you use config.xml <preference name="SplashScreenDelay" value="7000"/>

For ios use navigator.splashscreen.hide(). Use config.xml: <gap:plugin name="org.apache.cordova.splashscreen" version="0.2.3" /> and make sure your files are named correctly in config.xml:

<gap:splash src="splash.png" />
<gap:splash src="Resources/splash/Default~iphone.png" gap:platform="ios" width="320" height="480" />
<gap:splash src="Resources/splash/Default@2x~iphone.png" gap:platform="ios" width="640" height="960" />
<gap:splash src="Resources/splash/Default-568h@2x~iphone.png" gap:platform="ios" width="640" height="1136" />
<gap:splash src="Resources/splash/Default-Landscape.png" gap:platform="ios" width="768" height="1024 " />
<gap:splash src="Resources/splash/Default-Portrait.png" gap:platform="ios" width="1024" height="768" />
<gap:splash src="Resources/splash/Default-...@2x.png" gap:platform="ios" width="1536" height="2048" />
<gap:splash src="Resources/splash/Default-...@2x.png" gap:platform="ios" width="2048" height="1536" />

Good luck.

Steve Husting

unread,
Jun 13, 2014, 11:42:28 AM6/13/14
to phon...@googlegroups.com
https://github.com/apache/cordova-plugin-splashscreen/blob/master/doc/index.md

The above page doesn't indicate that you don't use .hide for Android.

The following page tells us to use .hide for Android:


Regards,
Steve Husting


On Thursday, June 12, 2014 2:45:17 AM UTC-7, Ben Atack wrote:
You should probably ask your question here: 

You don't use navigator.splashscreen.hide(); for android. you use config.xml <preference name="SplashScreenDelay" value="7000"/>

For ios use navigator.splashscreen.hide(). Use config.xml: <gap:plugin name="org.apache.cordova.splashscreen" version="0.2.3" /> and make sure your files are named correctly in config.xml:

<gap:splash src="splash.png" />
<gap:splash src="Resources/splash/Default~iphone.png" gap:platform="ios" width="320" height="480" />
<gap:splash src="Resources/splash/Default@2x~iphone.png" gap:platform="ios" width="640" height="960" />
<gap:splash src="Resources/splash/Default-568h@2x~iphone.png" gap:platform="ios" width="640" height="1136" />
<gap:splash src="Resources/splash/Default-Landscape.png" gap:platform="ios" width="768" height="1024 " />
<gap:splash src="Resources/splash/Default-Portrait.png" gap:platform="ios" width="1024" height="768" />
<gap:splash src="Resources/splash/Default-Port...@2x.png" gap:platform="ios" width="1536" height="2048" />
<gap:splash src="Resources/splash/Default-Land...@2x.png" gap:platform="ios" width="2048" height="1536" />

Ben Atack

unread,
Jun 13, 2014, 1:00:53 PM6/13/14
to phon...@googlegroups.com
I'm having the same issue as you.. 

If I resume the app.. it works fine.

If I tap the icon - it just hangs on the splash screen, and the events don't fire.
Reply all
Reply to author
Forward
0 new messages