White screen on iOS 10
Short description of the problem:
My app that's been working perfectly is broken after update to iOS 10 beta 1. Title bar shows, but nothing else does:
What behavior are you expecting?
App works :-)
Steps to reproduce:
- Open app, watch Splash Screen fade to failure
XCode log is as follows--the 'chmodding parent' and 'nw_connection_write_close' are new since this problem started occurring
2016-06-15 10:43:47.175994 Compass[1368:544061] Apache Cordova native platform version 4.1.1 is starting.
2016-06-15 10:43:47.177078 Compass[1368:544061] Multi-tasking -> Device: YES, App: YES
2016-06-15 10:43:47.356123 Compass[1368:544061] Using UIWebView
2016-06-15 10:43:47.359358 Compass[1368:544061] [CDVTimer][handleopenurl] 0.160038ms
2016-06-15 10:43:47.366226 Compass[1368:544061] [CDVTimer][intentandnavigationfilter] 6.722987ms
2016-06-15 10:43:47.366484 Compass[1368:544061] [CDVTimer][gesturehandler] 0.144958ms
2016-06-15 10:43:47.368666 Compass[1368:544061] [CDVTimer][keyboard] 2.053976ms
2016-06-15 10:43:47.592948 Compass[1368:544061] [CDVTimer][statusbar] 224.096954ms
2016-06-15 10:43:47.643507 Compass[1368:544061] [CDVTimer][splashscreen] 50.348997ms
2016-06-15 10:43:47.643608 Compass[1368:544061] [CDVTimer][TotalPluginStartup] 284.527004ms
2016-06-15 10:43:47.660604 Compass[1368:544061] createNotificationChecker
2016-06-15 10:43:47.660670 Compass[1368:544061] not coldstart
2016-06-15 10:43:48.470369 Compass[1368:544061] active
2016-06-15 10:43:48.472392 Compass[1368:544061] PushPlugin skip clear badge
2016-06-15 10:43:48.657253 Compass[1368:544061] Resetting plugins due to page load.
2016-06-15 10:43:49.467407 Compass[1368:544061] Finished load of: file:///var/containers/Bundle/Application/.../Compass.app/www/index.html#/
2016-06-15 10:43:59.410224 Compass[1368:544130] chmodding parent /private/var/mobile/Containers/Data/Application/.../Library/Cookies with perm 700
2016-06-15 10:44:01.585162 Compass[1368:544132] [] nw_connection_write_close 4 Connection is not ready, sending error callback
2016-06-15 10:44:01.585929 Compass[1368:544132] [] __tcp_connection_write_eof_block_invoke Write close callback received error: [57] Socket is not connected
2016-06-15 10:44:01.651129 Compass[1368:544130] [] nw_connection_write_close 1 Connection is not ready, sending error callback
2016-06-15 10:44:01.651646 Compass[1368:544130] [] __tcp_connection_write_eof_block_invoke Write close callback received error: [57] Socket is not connected
2016-06-15 10:44:01.788771 Compass[1368:544130] [] nw_connection_write_close 6 Connection is not ready, sending error callback
2016-06-15 10:44:01.789196 Compass[1368:544130] [] __tcp_connection_write_eof_block_invoke Write close callback received error: [57] Socket is not connected
2016-06-15 10:44:02.774359 Compass[1368:544130] [] nw_connection_write_close 3 Connection is not ready, sending error callback
2016-06-15 10:44:02.774568 Compass[1368:544130] [] __tcp_connection_write_eof_block_invoke Write close callback received error: [57] Socket is not connected
Which Ionic Version? 1.7.15
ionic info output
Cordova CLI: 6.1.1
Gulp version: CLI version 3.8.11
Gulp local: Local version 3.9.1
Ionic Framework Version: 1.3.1
Ionic CLI Version: 1.7.15
Ionic App Lib Version: 0.7.2
ios-deploy version: 1.8.5
ios-sim version: 3.1.1
OS: Mac OS X El Capitan
Node Version: v6.0.0
Xcode version: Xcode 8.0 Build version 8S128d
Also fails with Xcode version: Xcode 7.3.1 Build version 7D1014
Not sure what to do with this, going to start by removing all the plugins/regenerating the project... but I'm a little afraid about users updating to iOS 10 and getting a white screen...
@arcreative I've been looking into iOS10 and testing things out and this hasn't happened in my tests yet. With the app on the device, can you attach the safari dev tools to remote inspect. If there are any JS or loading errors, they would be visible there.
Also worth noting iOS10 is still super early beta 😁
@mhartington Thanks for the quick response. I'll try that, but to the best of my knowledge, Safari inspector closes every time, meaning the JS startup errors don't get logged because I can't get it to pop up prior to the app loading. Do you know of a way around that? Also, I don't see any JS errors in the Xcode console, they should show there, right?
Hmm, they should, show up in xcode, but it was just a thought.
The readout in the xcode doesn't look to promising. It could be related to a native issue with a plugin, I did see a lot of warnings in my tests.
What plugins are you using? (ionic plugin ls)
Looks like they messed with CSP again... the following were repeatedly showing in the JS console:
[Error] Refused to load gap://ready because it appears in neither the child-src directive nor the default-src directive of the Content Security Policy.
[Error] Refused to connect to file:///var/containers/Bundle/Application/<...>/Compass.app/www/templates/login.html because it appears in neither the connect-src directive nor the default-src directive of the Content Security Policy. (x6)
Ahh alright, that looks to be the case then.
Disabling CSP fixes it for now, will figure out the correct directives. Thanks again!
Facing the same issue here, my app became white screen after the splashscreen has been loaded. Hopefully Apple will fix the issues. 😢
I had the exact same issue with CSP. Adding default-src 'self' gap://ready; in the CSP meta tag located in index.html fixed it.
@ohh2ahh Yep, in my case I had to add file://* as well.
Hey folks, I'm having the same problem with the latest IOS 10 beta (simulator) This is my CSP
<meta http-equiv="Content-Security-Policy" content="img-src * 'self' data:; default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; ">
What exactly needs to change?
I don't see any CSP Related errors in console - all I see
2016-06-23 14:29:58.336940 zmNinja[34401:3690385] bundleid: com.pliablepixels.zmninja-pro, enable_level: 0, persist_level: 0, propagate_with_activity: 0
2016-06-23 14:29:58.340318 zmNinja[34401:3690385] subsystem: com.apple.UIKit, category: HIDEvents, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-23 14:29:58.352215 zmNinja[34401:3690381] Created DB, header sequence number = 256
2016-06-23 14:29:58.365894 zmNinja[34401:3690381] Created DB, header sequence number = 256
2016-06-23 14:29:58.393386 zmNinja[34401:3690381] subsystem: com.apple.BaseBoard, category: MachPort, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-23 14:29:58.443433 zmNinja[34401:3690388] subsystem: com.apple.FrontBoard, category: Common, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-23 14:29:58.565321 zmNinja[34401:3690129] subsystem: com.apple.UIKit, category: GestureEnvironment, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-23 14:29:59.029000 zmNinja[34401:3690129] #WK: Starting frame load, frame = 0x1233bc000, main = 1
2016-06-23 14:29:59.051941 zmNinja[34401:3690129] subsystem: com.apple.coremedia, category: , enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-23 14:29:59.343928 zmNinja[34401:3690415] #WK: Finished frame load without error, frame = 0x1233bc000, main = 1
fixed - in my case, I had to add gap:
how should I add this gap? I've tried all combinations. Can you please show ur CSP
@renanss https://github.com/pliablepixels/zmNinja/blob/master/www/index.html#L10
Thank you! Live saver!
@pliablepixels - do you know what the difference is between what you used and what was suggested at first?
default-src 'self' gap://ready ;
vs
default-src * 'self' gap: ;
Hi @arcreative, I am seeing issues with file as well, but not sure where to add file://*. Can you please show me the code snippet, specifically how it should look with gap://ready
I current have default-src * 'self' gap://ready file:// ; but it doesn't seem to be working?
@jacquesdev I don't think you should be using file://, if I remember correctly. Try using relative links to your files with ./filename or ./dir/filename since file:// is bound to be unreliable--I'll try to post what's been working for me later.
@arcreative - of thanks for getting back to me, the reason I thought it is required is because I am getting this error when running my app:
Refused to connect to blob:file:///e0967858-e565-43fa-84a9-c6ecc48de1d9 because it appears in neither the connect-src directive nor the default-src directive of the Content Security Policy.
I assumed this is why you mentioned you have to add it?
@jacquesdev not sure what you're trying to do, but looks like something is going wrong there. I don't feel like blob:file: is either a valid protocol or going to yield anything working. Are you using relative links for your sources, e.g. ./whatever.jpg?
@jacquesdev Sorry, misspoke. I'm using the following CSP tag:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' gap://ready file://* *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' localhost:35729">