-
Notifications
You must be signed in to change notification settings - Fork 358
Possible Race Condition on iPhone 11 Pro on Start Up #138
Comments
Just wondering, are you missing the following in config.xml?
Also, I do not see cordova-plugin-splashscreen v5.0.3 listed in your plugin list. |
Is the splashscreen plugin necessary for the application to load? However I migrated to capacitor due to the very low maintenance of cordova so I can close this issue. |
Hi - Any update on this? I am having the same exact issue. It seems that the white screen appears for me only when |
Do yourself a favour and migrate to ionic capacitor if possible. Its much easier to set up, its compatible with cordova plugins and its still maintained properly. That whitescreen of death will only get worse with each new iOS version.
I assume this will enable UIWebView again which is announced to be rejected in the AppStore from April 2020. |
This means you are not using the proper config.xml settings or a plug you are using is causing the issue. See: https://cordova.apache.org/howto/2020/03/18/wkwebviewonly.html on proper configuartion. If you are using Onsen, make sure you call:
in oDeviceReady() If using Monaca.io, see the following: Select "Configure -> App Settings for iOS" from the IDE header menu and update the item "WebView Engine" to "WKWebView". |
Not sure about your exact setup, but making a statement like that is not helpful when there is in fact lots going on in Cordova, see: https://cordova.apache.org/blog/ |
OK! then forgive me my passive agressive statement, it was due to days of long and frustrating trial and error. Including all combinations of fixes(yes also fastclick.destroy) from the few information that I found on those very specific problems. My builds remained failing randomly on all the possible iOS devices, when I got it working on one it started something strange on another. In the end I reflected that this should not be the development experience and I switched to capacitor which does everything cordova did right but has leaner xcode and android studio projects (just as I always wished from cordova) and helps much better to get a foot into the native API and custom native code. And its true when critical plugins like this have about 10 issues from 2019 which haven't been answered yet and a JIRA board with half of the issues in "won't fix" state there is a clear lack of maintenance. Thats only my personal opinion and I indeed wanted to help you with my recommendation to migrate. I know depending on the app size migration can be a terrifying imagination. In my special case it solved this problem and every other quirks that I procrastinated to just get the critical functionality of my app working. I did the migration of the whole project on both platforms in half a day including the plugins which was totally worth it compared to the previous two weeks of headache. See also apache/cordova#163. At least it's not a waste of time to start a small capacitor sample app. However I can understand if your app is heavily dependent on many cordova plugins. Then migration would be a huge pain. Unfortunately i'm not the right one to help in this case but would leave the issue open for discussion. |
Is this reproducible in a new, plain Cordova app? A minimal reproduction repository would really help to debug and later fix this issue. More information on how to create one: https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md |
Facing the same issue White Screen appears after upgrade UIWebView to WKWebView Plugin #141 . Please help to resolve this issue. |
@timbru31 issue is with ios 13 version with WKWebView |
That’s not what we’ve asked for. |
I've got this behaviour yesterday. The error in the XCode log field was something like "ERROR ... ready not defined". |
Again, writing "I'm having the same problem" does not help to debug the issue. We need a reproducible example in a plain Cordova app. |
I think we have a problem with time pressure here. People are forced to migrate and have no time to provide a minimum example. Can you maybe use my sleep hack as a hint where the unstable behaviour in the native bridge happens? |
@timbru31 reproduction repository has been created, please fetch the below repository. |
@timbru31 Issue reproduced repository is created. Can you get the checkout and assist to resolve the issue ? |
We are archiving this repository following Apache Cordova's Deprecation Policy. We will not continue to work on this repository. Therefore all issues and pull requests are being closed. Thanks for your contribution. |
Bug Report
Problem
Our customers report random white screens on app launch on iOS devices. While almost all devices happen to launch the app successfully after some retries the iPhone 11 Pro always starts with a white screen. That got me (after long blackbox digging) to the assumption that fast iPhones have the Problem and that WKWebView maybe starts with a race condition.
On my iPhone 11 Pro simulator I luckily got a 50/50 chance of a white screen so I started debugging
CDVWKWebKitViewEngine.m
. I have absolutely no knowledge in Objective-C so I just restarted over and over again to spot randomly the differences in the call stack. While doing this I slowly got an understanding of how the plugin might be working under the hood.userContentController:didReceiveScriptMessage
seems to play a role in the successful startup of the container and all scripts and assets being loaded.After a long time I recognized that breaking the code at line 321 in
CDVWKWebKitViewEngine.m
got the app working constantly in the simulator which brought me adding a sleep timer in line 321:That at least got the app starting without breakpoints in the simulator. However on the physical device it kept the white screen.
I will now go on debugging to spot another point. But any help or hints are highly appreciated.
What is expected to happen?
App should start correctly after splash screen.
CDVWKWebKitViewEngine.m
->userContentController:didReceiveScriptMessage
should be fired on every App start reliably.What does actually happen?
userContentController:didReceiveScriptMessage
is only fired on iPhone 11 Pro Simulator, iOS 13.3 when[NSThread sleepForTimeInterval:1.0];
is added in line 321 inCDVWKWebKitViewEngine.m
:Without adding the sleep line I encounter a white screen in 5 out of 10 cases in the simulator.
userContentController:didReceiveScriptMessage
is not fired in those cases.On physical iPhone 11 Pro, iOS 13.3.1 the app launches constantly with a white screen after splash and
userContentController:didReceiveScriptMessage
is not fired - even if I set the sleep to 5 seconds.Information
Command or Code
Environment, Platform, Device
Version information
Cordova:
React:
XCode: 11.3.1
MacOS Catalina 10.15.4
Checklist
The text was updated successfully, but these errors were encountered: