App hangs on launch when WKWebView plugin is removed

We’re building an application that uses the WKWebView plugin. The app launches ok and works. However, on iOS devices we get CORS issues so I thought I’d try removing the plugin (as there are known CORS issues with it). After removal of the plugin the CORS issues have gone away. However, when the app launches it hangs (on a black screen after the splash-screen has been displayed) and the following is shown in the log. The app seems to hang just before the deviceready event is fired.

2017-08-16 14:30:06.887506+0100 pmx-ionic2[4277:1053541] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/776F67CF-912E-44F3-8C94-11057DEDFE16/Library/Cookies/Cookies.binarycookies
2017-08-16 14:30:06.944430+0100 pmx-ionic2[4277:1053541] Apache Cordova native platform version 4.3.1 is starting.
2017-08-16 14:30:06.945072+0100 pmx-ionic2[4277:1053541] Multi-tasking -> Device: YES, App: YES
2017-08-16 14:30:07.008222+0100 pmx-ionic2[4277:1053541] Using UIWebView
2017-08-16 14:30:07.009433+0100 pmx-ionic2[4277:1053541] [CDVTimer][handleopenurl] 0.060022ms
2017-08-16 14:30:07.011315+0100 pmx-ionic2[4277:1053541] [CDVTimer][intentandnavigationfilter] 1.833022ms
2017-08-16 14:30:07.011404+0100 pmx-ionic2[4277:1053541] [CDVTimer][gesturehandler] 0.051022ms
2017-08-16 14:30:07.030343+0100 pmx-ionic2[4277:1053541] [CDVTimer][splashscreen] 18.890023ms
2017-08-16 14:30:07.038846+0100 pmx-ionic2[4277:1053541] [CDVTimer][statusbar] 8.404016ms
2017-08-16 14:30:07.039716+0100 pmx-ionic2[4277:1053541] VERSION LABEL: 0.1.10:1502881073:NO_DEPLOY_LABEL
2017-08-16 14:30:07.039737+0100 pmx-ionic2[4277:1053541] updating version label
2017-08-16 14:30:07.040696+0100 pmx-ionic2[4277:1053541] [CDVTimer][ionicdeploy] 1.785994ms
2017-08-16 14:30:07.041543+0100 pmx-ionic2[4277:1053541] [CDVTimer][keyboard] 0.759959ms
2017-08-16 14:30:07.041603+0100 pmx-ionic2[4277:1053541] [CDVTimer][TotalPluginStartup] 32.263994ms
2017-08-16 14:30:07.128197+0100 pmx-ionic2[4277:1053541] createNotificationChecker
2017-08-16 14:30:07.128249+0100 pmx-ionic2[4277:1053541] not coldstart
2017-08-16 14:30:07.129609+0100 pmx-ionic2[4277:1053541] active
2017-08-16 14:30:07.129758+0100 pmx-ionic2[4277:1053541] PushPlugin skip clear badge
2017-08-16 14:30:07.240305+0100 pmx-ionic2[4277:1053541] Resetting plugins due to page load.
2017-08-16 14:30:07.240466+0100 pmx-ionic2[4277:1053541] uuid is:
2017-08-16 14:30:07.240483+0100 pmx-ionic2[4277:1053541] ignore deploy
2017-08-16 14:30:07.240494+0100 pmx-ionic2[4277:1053541] ignore version: NO_DEPLOY_LABEL
> 2017-08-16 14:30:12.850777+0100 pmx-ionic2[4277:1053682] libMobileGestalt MobileGestaltSupport.m:153: pid 4277 (pmx-ionic2) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled
> 2017-08-16 14:30:12.850825+0100 pmx-ionic2[4277:1053682] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see rdar://problem/11744455)
2017-08-16 14:30:13.122617+0100 pmx-ionic2[4277:1053541] Finished load of: file:///var/containers/Bundle/Application/5170C3A8-05D0-4C58-8AFE-2B1D23DC728B/

If I then close the app on this black screen, things continue ok and the log shows this i.e the deviceready event fires.

017-08-16 14:30:23.047771+0100 pmx-ionic2[4277:1053541] THREAD WARNING: [‘Device’] took ‘52.430176’ ms. Plugin should use a background thread.
2017-08-16 14:30:23.768908+0100 pmx-ionic2[4277:1053541] Ionic Native: deviceready event fired after 15474 ms
2017-08-16 14:30:23.776349+0100 pmx-ionic2[4277:1053541] null pin status
2017-08-16 14:30:23.776349+0100 pmx-ionic2[4277:1053870] Push Plugin register called
2017-08-16 14:30:23.776414+0100 pmx-ionic2[4277:1053870] PushPlugin.register: setting badge to false
2017-08-16 14:30:23.776416+0100 pmx-ionic2[4277:1053541] login.component.ts:
2017-08-16 14:30:23.776430+0100 pmx-ionic2[4277:1053870] PushPlugin.register: clear badge is set to 0
2017-08-16 14:30:23.776453+0100 pmx-ionic2[4277:1053870] PushPlugin.register: better button setup
2017-08-16 14:30:23.779541+0100 pmx-ionic2[4277:1053870] GCM Sender ID (null)
2017-08-16 14:30:23.779579+0100 pmx-ionic2[4277:1053870] Using APNS Notification

If I re-opening the app at this point, all is well.

Presumably, something is causing the highlighted errors to occur resulting in the app hanging. If I add the WKWebView plugin back in, the app launches ok (but with CORS issues re-introduced). Anyone have any idea what might be causing this problem when the WKWebView plugin is removed? thanks.