White Screen of Death in Emulator


#1

Continuing the discussion from Emulate iOS - white screen:

I’m having this white screen “of death” problem. I’ve tried removing and reloading some of my plugins, moving the www folder to a new project, and updating and reinstalling cordova and ios-sim. But I can’t seem to kick it. Building from Xcode also gives the white screen and the console in Xcode looks vanilla:

2014-04-25 10:50:31.662 Project[37507:60b] active 
2014-04-25 10:50:31.782 Project[37507:60b] Resetting plugins due to page load.
2014-04-25 10:50:32.430 Project[37507:60b] Finished load of: file:///USER/COMPUTER/Library/Application%20Support/iPhone%20Simulator/7.1-64/Applications/C26942C2-1DDF-444B-943B-9F989854A434/Project.app/www/index.html

cordova run ios yields the white screen and outputs this:

** BUILD SUCCEEDED **

2014-04-25 10:53:35.392 ios-sim[37829:507] stderrPath: /Users/Achilles/Desktop/dev/project-ionic/platforms/ios/cordova/console.log
2014-04-25 10:53:35.393 ios-sim[37829:507] stdoutPath: /Users/Achilles/Desktop/dev/project-ionic/platforms/ios/cordova/console.log

#2

And your app does display in the browser?


#3

In my experience, the white screen means that I have a syntax error somewhere in my javascript. Try loading the app in a web browser and checking the console for errors.


#4

Sorry. Yes everything works well in browser. White screen after splashscreen in ios. I have not tried android simulator.


#5

@udi is right; most of the time it’s due to an error in a javascript file.

One general good thing to do is to install the Cordova console plugin (https://github.com/apache/cordova-plugin-console). This outputs javascript errors to the Xcode console that you might not catch with Safari web inspector because the app is already loaded before you can open up those tools.

Other things to check:

  • Are you seeing any javascript errors in your browser when you open your app there? If there any big nasty Angular errors there, chances are Cordova might trip over them once you deploy to a simulator or device.
  • Are you using other cordova plugins?
  • Are you calling on those plugins whilst they might not be correctly loaded?
  • If you’re using cordova plugins and you’re calling them are you sure you’re doing that after device ready has fired? (Check out the Ionic Platform Ready function, it’s basically a wrapper for deviceready that you can use in your controller)
  • If the app still won’t compile, try removing cordova plugins and any js code that calls on them to see if you can get a basic version of the app going, then slowly add pieces one by one until you find the source of the problem.

#6

Good ideas.

I found that if I add just plain text to the index.html file that outputs on the screen, so maybe the way I am using the ion-nav-bar is not right.

<body ng-app="APPNAMEFROMAPPJS" animation="slide-left-right-ios7">

    <ion-nav-bar ng-class="(barClass) ? barClass : 'bar-positive'"></ion-nav-bar>
    <ion-nav-view></ion-nav-view>

</body>

I don’t have any major javascript errors. But sometimes angular is not found and I have to refresh in the browser (but this has always happened with ionic in dev even when the simulator did work).

I removed all cordova plugins and all code calling any of them that I know of and still white screen in emulator, working in browser. I was already calling these plugins with the IonicPlatform.ready() method (neat!)

I added back console, device, and statusbar (because the ionic seed ships with those). Still no change.

I built the app from xcode and go the following from the console:

> 2014-04-26 20:02:08.885 Coride.co[61041:60b] Multi-tasking -> Device: YES, App: YES
> 2014-04-26 20:02:08.987 Coride.co[61041:60b] Unlimited access to network resources
> 2014-04-26 20:02:09.396 Coride.co[61041:60b] [CDVTimer][statusbar] 113.084018ms
> 2014-04-26 20:02:09.396 Coride.co[61041:60b] [CDVTimer][TotalPluginStartup] 113.685966ms
> 2014-04-26 20:02:09.846 Coride.co[61041:60b] Resetting plugins due to page load.
> 2014-04-26 20:02:10.448 Coride.co[61041:60b] Finished load of: file:///Users/MYCOMPUTER/Library/Application%20Support/iPhone%20Simulator/7.1-64/Applications/4C5DBDA1-D00F-4E74-9A6E-6C45CF94B0AD/APPLICATION.co.app/www/index.html#/login

sometimes I get this at the end of the console, but not always.

2014-04-26 20:19:00.821 Coride.co[63654:60b] THREAD WARNING: ['Device'] took '37.980957' ms. Plugin should use a background thread. 

another weird thing is in XCode it says “memory 45mb” on the left and my computer gets all hot when run the app.


#7

Hmmm. Either there is a bug in your code or there is something wrong with your Xcode / Simulator setup. Just as a way to test you could try deploying one of the starter apps to the simulator or your phone. If this does work, you at least know the error lies within your app or not.


#8

Great idea. Unfortunately, the seed project runs clean in the simulator so it must just be a bug in my code. Wow. I guess I am stuck to taking out code until it works again and then building everything back up.


#9

So I started to just comment out code and finally If found the issue.

At the top of app.js I was setting my google mapOptions as an object. This worked in the web, but not working in the app. Perhaps I need to use google map plugin.

.run(function ($rootScope, google) {
  $rootScope.mapOptions = {
    center: '',
    streetViewControl: false,
    panControl: false,
    zoomControlOptions: {
       style: google.maps.ZoomControlStyle.SMALL
     },
    zoom: 7,
    minZoom: 2,
    maxZoom: 9,
    scrollwheel: false,
    navigationControl: false,
    mapTypeControl: false,
    scaleControl: false,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
})

#10

I had the white screen issue as well, and it turned out that I forgot to run gulp to do a bunch of preprocessing. However, I really found using the Developer Tools in Safari to clear up any problems. Take a look at http://moduscreate.com/enable-remote-web-inspector-in-ios-6/.


Blank page when running "ionic emulate ios"
#11

Hello there!
I have a similar or the same problem. Until yesterday I was able to test my ionic app on iphone simulator without problems, but now when I try to build and emulate ios I get a white or black screen. As suggested, I tried to start with a clean project sidemenu but I get the same black page!

Looking the log there are some errors, warnings and notices… here the log:

Jul 3 11:11:21 mymac.local SimulatorBridge[5507] : LaunchServices: installing app for existing placeholder LSApplicationProxy: com.ionicframework.starter
Jul 3 11:11:21 mymac.local SimulatorBridge[5507] : LaunchServices: Not creating progress for LSApplicationProxy: com.ionicframework.starter since it is not a placeholder.
Jul 3 11:11:21 mymac.local installd[5502] : 0xb0093000 handle_install_for_ls: Install of “/Users/manzapanza/Projects/ionicSideMenu/platforms/ios/build/emulator/HelloCordova.app” requested by SimulatorBridge
Jul 3 11:11:21 mymac.local installd[5502] : 0xb0093000 MobileInstallationInstall_Server: Installing app com.ionicframework.starter
Jul 3 11:11:21 mymac.local installd[5502] : 0xb0093000 MobileInstallationInstall_Server: Staging: 0.06s; Waiting: 0.00s; Installation: 0.17s; LS Sync: 0.00s; Overall: 0.23s
Jul 3 11:11:21 mymac.local lsd[5514] : LaunchServices: Updating identifier store
Jul 3 11:11:21 mymac.local SpringBoard[5505] : libMobileGestalt MobileGestalt.c:835: still-camera is static and will never generate a notification
Jul 3 11:11:21 mymac.local SpringBoard[5505] : libMobileGestalt MobileGestalt.c:835: stand-alone-contacts is static and will never generate a notification
Jul 3 11:11:21 mymac.local backboardd[5495] : __hid_dispatch_pthread_root_queue_create_block_invoke: specific=0x6027fa0 pthread_self=0xb029b000
Jul 3 11:11:21 Mac-mini-di-Massimo com.apple.iphonesimulator.launchd.2f7b2d86[5493] (UIKitApplication:com.ionicframework.starter[0x756b][7465]) : Service exited due to signal: Killed: 9
Jul 3 11:11:21 mymac.local backboardd[5495] : Application ‘UIKitApplication:com.ionicframework.starter[0x756b]’ exited abnormally with signal 9: Killed: 9
Jul 3 11:11:21 mymac.local SpringBoard[5505] : BKSWorkspace: Ignoring exit of com.ionicframework.starter as it is pending activation, and will be relaunched.
Jul 3 11:11:22 mymac.local SpringBoard[5505] : 2014-07-03 11:11:22.488|5505|0x1394f7a0: Region monitoring not available or enabled. Trigger ignored!
Jul 3 11:11:22 mymac.local backboardd[5495] : CoreAnimation: timed out fence 2f3b
Jul 3 11:11:22 mymac.local HelloCordova[8055] : Multi-tasking -> Device: YES, App: YES
Jul 3 11:11:22 mymac.local HelloCordova[8055] : Unlimited access to network resources
Jul 3 11:11:22 mymac.local HelloCordova[8055] : Fix applied for database locations?: YES
Jul 3 11:11:22 mymac.local HelloCordova[8055] : [CDVTimer][keyboard] 0.100017ms
Jul 3 11:11:22 mymac.local HelloCordova[8055] : CDVPlugin class CDVStatusBar (pluginName: statusbar) does not exist.
Jul 3 11:11:22 mymac.local HelloCordova[8055] : [CDVTimer][statusbar] 0.447989ms
Jul 3 11:11:22 mymac.local HelloCordova[8055] : [CDVTimer][TotalPluginStartup] 1.641989ms
Jul 3 11:11:22 mymac.local SpringBoard[5505] : No transaction in -[SBWorkspace workspace:applicationActivated:]
Jul 3 11:11:22 mymac.local HelloCordova[8055] : Resetting plugins due to page load.
Jul 3 11:11:23 mymac.local HelloCordova[8055] : Finished load of: file:///Users/manzapanza/Library/Application%20Support/iPhone%20Simulator/7.0.3/Applications/CF04BC2F-5636-4124-9AA7-2A7CB118390C/HelloCordova.app/www/index.html#/app/playlists
Jul 3 11:13:08 mymac.local backboardd[5495] : __hid_dispatch_pthread_root_queue_create_block_invoke: specific=0x6027fa0 pthread_self=0xb0115000
Jul 3 11:13:08 mymac.local backboardd[5495] : __hid_dispatch_pthread_root_queue_create_block_invoke: specific=0x6027d90 pthread_self=0xb0197000
Jul 3 11:13:21 mymac.local backboardd[5495] : __hid_dispatch_pthread_root_queue_create_block_invoke: specific=0x6027fa0 pthread_self=0xb0115000
Jul 3 11:13:21 mymac.local backboardd[5495] : __hid_dispatch_pthread_root_queue_create_block_invoke: specific=0x6027d90 pthread_self=0xb0197000
Jul 3 11:20:06 mymac.local backboardd[5495] : __hid_dispatch_pthread_root_queue_create_block_invoke: specific=0x6027fa0 pthread_self=0xb0115000
Jul 3 11:20:06 mymac.local backboardd[5495] : __hid_dispatch_pthread_root_queue_create_block_invoke: specific=0x6027d90 pthread_self=0xb019700

Some ideas?
Thanks!


#12

Hi there!
I solve my problem closing the iphone Simulator, and then deleting the folder /Users/myuser/Application Support/iPhone Simulator.


#13

Open safari, open your app in simulator and navigate to safari developer tool. Choose ios simulator to debug. You will see some error which don’t show up in Web browsers. Fix those and you are good to go.


#14

Thank you, @manzapanza!

I was seeing this problem using the stock sidemenu project. Deleting the folder fixed it.

Slight path correction: the folder is at:

/Users/myuser/Library/Application Support/iPhone Simulator

(/Library was missing in the above post)