microsoft / cordova-plugin-code-push

Cordova plugin for CodePush
http://appcenter.ms
Other
644 stars 335 forks source link

iOS 12: Failed to load webpage with error: The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 1.) #647

Open subinkrishna opened 4 years ago

subinkrishna commented 4 years ago

Description

Unable to load the installed code push bundle when InstallMode is IMMEDIATE or ON_NEXT_RESUME.

Logs (for IMMEDIATE):

Installing update
[CodePush] Installing update
[CodePush] Applying full update
[CodePush] Install succeeded.
The update was installed successfully.
=================================================================
Main Thread Checker: UI API called on a background thread: -[WKWebView loadFileURL:allowingReadAccessToURL:]
PID: 3751, TID: 363261, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0
IAB.close() called but it was already closed.
Failed to load webpage with error: The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 1.)

Reproduction

Followed samples/basic/www/js/index.js with InstallMode.IMMEDIATE

Additional Information

pitAlex commented 4 years ago

This ios12 crash happens for us as well although in our case its set as ON_NEXT_RESTART. It cannot be replicated in the simulator, we have just one iPhone 5s with ios12 and... the person is in a different country and does not have a mac. Do you guys have an advice on what logs to put where to properly capture this?

pitAlex commented 4 years ago

Comming with an update, we managed to remotely debug it. And we see the same thing kCFErrorDomainCFNetwork 1. Our app is not using the new URL scheme introduced with Cordova iOS 6.

pitAlex commented 4 years ago

Hello, so I've been digging around and I've noticed that CDVWKWebViewEngine+CodePush.m doesn't seem to be used. I mean in codePush.m on line [self.webViewEngine loadRequest:[NSURLRequest requestWithURL:url]]; it seems to invoke that from CDVWebViewEngine.m. I may be completely off but were are on a deadline here and I am doing what I can to figure this one out.

pitAlex commented 4 years ago

I have a new update. I believe this is a cordova-ios issue or this plugin needs to be updated to overwrite CDVWebViewEngine loadRequest method. I've installed cordova-plugin-ionic-webview, leaving everything as default and the updates worked. If developers could confirm this, we should open the issue on the cordova-ios repo as well.

subinkrishna commented 4 years ago

@alexandergoncharov - Hey! sorry to tag you to this ticket, but looks like you mostly maintain this repo. Do you have any thoughts or updates related to this issue?