ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

White screen on iOS 10

Open arcreative opened this issue 10 years ago • 54 comments

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:

img_9372

What behavior are you expecting?

App works :-)

Steps to reproduce:

  1. 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 avatar Jun 15 '16 18:06 arcreative

@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 avatar Jun 15 '16 19:06 mhartington

@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?

arcreative avatar Jun 15 '16 19:06 arcreative

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)

mhartington avatar Jun 15 '16 19:06 mhartington

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)

arcreative avatar Jun 15 '16 19:06 arcreative

Ahh alright, that looks to be the case then.

mhartington avatar Jun 15 '16 19:06 mhartington

Disabling CSP fixes it for now, will figure out the correct directives. Thanks again!

arcreative avatar Jun 15 '16 19:06 arcreative

Facing the same issue here, my app became white screen after the splashscreen has been loaded. Hopefully Apple will fix the issues. 😢

yihyang avatar Jun 16 '16 08:06 yihyang

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 avatar Jun 16 '16 08:06 ohh2ahh

@ohh2ahh Yep, in my case I had to add file://* as well.

arcreative avatar Jun 16 '16 14:06 arcreative

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

pliablepixels avatar Jun 23 '16 18:06 pliablepixels

fixed - in my case, I had to add gap:

pliablepixels avatar Jun 23 '16 18:06 pliablepixels

how should I add this gap? I've tried all combinations. Can you please show ur CSP

renanss avatar Jun 25 '16 00:06 renanss

@renanss https://github.com/pliablepixels/zmNinja/blob/master/www/index.html#L10

pliablepixels avatar Jun 25 '16 00:06 pliablepixels

Thank you! Live saver!

renanss avatar Jun 25 '16 00:06 renanss

@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: ;

jacquesdev avatar Aug 22 '16 10:08 jacquesdev

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 avatar Aug 22 '16 10:08 jacquesdev

@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 avatar Aug 22 '16 15:08 arcreative

@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 avatar Aug 22 '16 15:08 jacquesdev

@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?

arcreative avatar Aug 23 '16 04:08 arcreative

@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">

arcreative avatar Aug 23 '16 16:08 arcreative