简体   繁体   中英

iOS cordova app hangs after splash screen

I am compiling a new version of my app and after the splash screen on both device and simulator the screen just goes blank. The last version of the app I built worked just fine...the current version launches just fine on Android devices. The below logs are pretty much the same from when the app was launching without issue so I have no idea whats causing this WOD. How can I troubleshoot this? How else can I get real logs of why screen is hanging?

In Safari Inspector, I can see what looks like the entire app html loading just fine...it seems like its all there. As well, there are zero JS/AngularJS errors being reported in the console logs.

I added some console.logs to see if I could pinpoint where things were at least getting to but not even they are printing to console in Xcode or Safari inspector.

Here is my environment:

ionic info

Ionic:

   Ionic CLI         : 5.4.4 (/usr/local/lib/node_modules/ionic)
   Ionic Framework   : ionic1 1.0.0
   @ionic/v1-toolkit : 1.0.22

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : ios 5.0.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, (and 32 other plugins)

Utility:

   cordova-res : 0.6.0 (update available: 0.9.0)
   native-run  : 0.2.8 (update available: 0.3.0)

System:

   ios-deploy : 1.9.4
   ios-sim    : 8.0.2
   NodeJS     : v10.16.3 (/usr/local/bin/node)
   npm        : 6.11.2
   OS         : macOS High Sierra
   Xcode      : Xcode 10.1 Build version 10B61

And the console logs, I don't believe any of the following errors/warnings should be causing the app to hang or go white screen - I have seen all of these before and none of them impacted the app. Most I have researched and seem benign.

2020-02-24 16:33:28.729280-0500 myApp[14811:15566848] Apache Cordova native platform version 5.0.1 is starting.
2020-02-24 16:33:28.729542-0500 myApp[14811:15566848] Multi-tasking -> Device: YES, App: YES
2020-02-24 16:33:28.790743-0500 myApp[14811:15566848] Using UIWebView
2020-02-24 16:33:28.793978-0500 myApp[14811:15566848] [CDVTimer][console] 0.138044ms
2020-02-24 16:33:28.794282-0500 myApp[14811:15566848] [CDVTimer][handleopenurl] 0.170946ms
2020-02-24 16:33:28.797984-0500 myApp[14811:15566848] Unlimited access to network resources
2020-02-24 16:33:28.798184-0500 myApp[14811:15566848] [CDVTimer][intentandnavigationfilter] 3.751993ms
2020-02-24 16:33:28.798528-0500 myApp[14811:15566848] [CDVTimer][gesturehandler] 0.252962ms
2020-02-24 16:33:28.799284-0500 myApp[14811:15566848] [CDVTimer][admob] 0.651956ms
2020-02-24 16:33:28.799605-0500 myApp[14811:15566848] Starting Facebook Connect plugin
2020-02-24 16:33:28.799703-0500 myApp[14811:15566848] [CDVTimer][facebookconnectplugin] 0.335932ms
2020-02-24 16:33:28.803213-0500 myApp[14811:15566848] [CDVTimer][file] 3.353000ms
2020-02-24 16:33:28.803581-0500 myApp[14811:15566848] Starting Firebase plugin
2020-02-24 16:33:28.810921-0500 myApp[14811:15566848] [CDVTimer][firebaseplugin] 7.617950ms
2020-02-24 16:33:28.811294-0500 myApp[14811:15566848] [CDVTimer][inappbrowser] 0.249028ms
2020-02-24 16:33:28.811595-0500 myApp[14811:15566848] [CDVTimer][uiinappbrowser] 0.189900ms
2020-02-24 16:33:28.811863-0500 myApp[14811:15566848] [CDVTimer][wkinappbrowser] 0.159979ms
2020-02-24 16:33:28.812128-0500 myApp[14811:15566848] CDVIonicKeyboard: resize mode 1
2020-02-24 16:33:28.814081-0500 myApp[14811:15566848] CDVIonicKeyboard: WARNING!!: Keyboard plugin works better with WK
2020-02-24 16:33:28.814370-0500 myApp[14811:15566848] [CDVTimer][keyboard] 2.269983ms
2020-02-24 16:33:28.821986-0500 myApp[14811:15567042] registerForRemoteNotifications
2020-02-24 16:33:28.830875-0500 myApp[14811:15566848] [CDVTimer][splashscreen] 16.288996ms
2020-02-24 16:33:28.842044-0500 myApp[14811:15566848] [CDVTimer][statusbar] 11.017084ms
2020-02-24 16:33:28.842496-0500 myApp[14811:15566848] [CDVTimer][diagnostic] 0.326037ms
2020-02-24 16:33:28.844525-0500 myApp[14811:15566848] [CDVTimer][diagnostic_location] 1.947999ms
2020-02-24 16:33:28.844721-0500 myApp[14811:15566848] [CDVTimer][diagnostic_notifications] 0.103951ms
2020-02-24 16:33:28.844770-0500 myApp[14811:15566848] [CDVTimer][TotalPluginStartup] 51.038027ms
2020-02-24 16:33:28.857988-0500 myApp[14811:15566848] GoogleService-Info.plist found, setup: [FIRApp configureWithOptions]
2020-02-24 16:33:28.889418-0500 myApp[14811:15566848] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2020-02-24 16:33:28.890284-0500 myApp[14811:15566848] [MC] Reading from public effective user settings.
2020-02-24 16:33:28.961518-0500 myApp[14811:15567038] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x280e2fda0, domain=1, instance=1>
2020-02-24 16:33:29.071782-0500 myApp[14811:15567057] Metal GPU Frame Capture Enabled
2020-02-24 16:33:29.079541-0500 myApp[14811:15567057] Metal API Validation Enabled
2020-02-24 16:33:29.249063-0500 myApp[14811:15567059] 6.3.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
2020-02-24 16:33:29.251884-0500 myApp[14811:15567059] 6.3.0 - [Firebase/Analytics][I-ACS025028] AdMob and Firebase are in use in this app, but are not linked. For analytics data consistency and integrity, it is highly recommended that you link your AdMob app to the corresponding Firebase app and re-download the GoogleServices-Info.plist file. See https://support.google.com/admob/answer/6383165 for more information.
2020-02-24 16:33:29.255383-0500 myApp[14811:15567059] 6.3.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60002000 started
2020-02-24 16:33:29.255771-0500 myApp[14811:15567059] 6.3.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled
2020-02-24 16:33:29.270990-0500 myApp[14811:15567042] _hasPermission: YES
2020-02-24 16:33:29.283845-0500 myApp[14811:15566848] didReceiveRegistrationToken: fOrgQHaXCTQ:APA91bFfK-xz7DpwU8AvnoXQybZY6xDawTkVwj6GtJGCbRDRz9E7IIyEvf0wycPIWffthW1J1p8JmafLu32WGWhvCJ8aoUT_cKMNERQ6fQ_7xjL-veEK5F7sPMc7BUEjee3cEbkKThSY
2020-02-24 16:33:29.293043-0500 myApp[14811:15566848] FCM direct channel = true
2020-02-24 16:33:29.303036-0500 myApp[14811:15566848] FB Hybrid app events cannot be enabled, this feature requires WKWebView
2020-02-24 16:33:29.309203-0500 myApp[14811:15567057] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x280e3b9c0, domain=1, instance=1>
2020-02-24 16:33:29.392367-0500 myApp[14811:15567038] 6.3.0 - [Firebase/Analytics][I-ACS025026] Deferring to Firebase for event data collection
2020-02-24 16:33:29.403092-0500 myApp[14811:15566848] didRegisterForRemoteNotificationsWithDeviceToken: <70ad34cb 9dac7233 966cd8b7 d1612273 03bad35a f08c430a bf1ed4c7 a257bac9>
2020-02-24 16:33:29.433757-0500 myApp[14811:15566848] Resetting plugins due to page load.
2020-02-24 16:33:29.434371-0500 myApp[14811:15566848] IAB.close() called but it was already closed.
2020-02-24 16:33:29.434464-0500 myApp[14811:15566848] IAB.close() called but it was already closed.
2020-02-24 16:33:29.457026-0500 myApp[14811:15566848] Failed to load webpage with error: The operation couldn’t be completed. (NSURLErrorDomain error -999.)
2020-02-24 16:33:29.470218-0500 myApp[14811:15566848] Resetting plugins due to page load.
2020-02-24 16:33:29.470385-0500 myApp[14811:15566848] IAB.close() called but it was already closed.
2020-02-24 16:33:29.470421-0500 myApp[14811:15566848] IAB.close() called but it was already closed.
2020-02-24 16:33:29.507982-0500 myApp[14811:15567061] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x102936400] get output frames failed, state 8196
2020-02-24 16:33:29.508234-0500 myApp[14811:15567061] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x102936400] get output frames failed, state 8196
2020-02-24 16:33:29.508700-0500 myApp[14811:15567061] TIC Read Status [1:0x0]: 1:57
2020-02-24 16:33:29.508743-0500 myApp[14811:15567061] TIC Read Status [1:0x0]: 1:57
2020-02-24 16:33:29.701653-0500 myApp[14811:15566848] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x280e572c0, domain=1, instance=1>
2020-02-24 16:33:29.713627-0500 myApp[14811:15567056] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2][0x1028093c0] get output frames failed, state 8196
2020-02-24 16:33:29.717303-0500 myApp[14811:15567056] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2][0x1028093c0] get output frames failed, state 8196
2020-02-24 16:33:29.718170-0500 myApp[14811:15567056] TIC Read Status [2:0x0]: 1:57
2020-02-24 16:33:29.718216-0500 myApp[14811:15567056] TIC Read Status [2:0x0]: 1:57
2020-02-24 16:33:29.719928-0500 myApp[14811:15567056] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C3.1:2][0x1028270e0] get output frames failed, state 8196
2020-02-24 16:33:29.720165-0500 myApp[14811:15567056] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C3.1:2][0x1028270e0] get output frames failed, state 8196
2020-02-24 16:33:29.720718-0500 myApp[14811:15567056] TIC Read Status [3:0x0]: 1:57
2020-02-24 16:33:29.720805-0500 myApp[14811:15567056] TIC Read Status [3:0x0]: 1:57
2020-02-24 16:33:29.787548-0500 myApp[14811:15567056] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C5.1:2][0x102832530] get output frames failed, state 8196
2020-02-24 16:33:29.788231-0500 myApp[14811:15567056] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C5.1:2][0x102832530] get output frames failed, state 8196
2020-02-24 16:33:29.788608-0500 myApp[14811:15567056] TIC Read Status [5:0x0]: 1:57
2020-02-24 16:33:29.788642-0500 myApp[14811:15567056] TIC Read Status [5:0x0]: 1:57
2020-02-24 16:33:29.914614-0500 myApp[14811:15567109] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C6.1:2][0x102833ed0] get output frames failed, state 8196
2020-02-24 16:33:29.914982-0500 myApp[14811:15567109] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C6.1:2][0x102833ed0] get output frames failed, state 8196
2020-02-24 16:33:29.918861-0500 myApp[14811:15567109] TIC Read Status [6:0x0]: 1:57
2020-02-24 16:33:29.918976-0500 myApp[14811:15567109] TIC Read Status [6:0x0]: 1:57
2020-02-24 16:33:30.569146-0500 myApp[14811:15566848] Finished load of: file:///var/containers/Bundle/Application/1613C55A-6D2F-4B41-A73F-A24DB76501E4/myApp.app/www/index.html

I used to have a similar problem in an app for Cordova (written with the ExtJS framework, not Ionic), where the app would hang after the splash screen, mostly on iOS.

The problem

Cordova was loading fine, but the framework was not. (For an unknown reason) So, index.html was loaded and the deviceready event was fired, but the framework was empty and couldn't start up.

Workaround

I never got to the root of the problem (and I suspect it's not related to yours), but since deviceready was fired, I check at runtime if the framework is loaded and reload the entire app if not. For the user point a view, the splashscreen appears only once, fades, the screen stays white (while the app is reloaded in the background) and the app appears.

In my index.html , something like that

function onDeviceReady() {
    //...

    try {
        var isFrameworkLoaded = ....

        if (isFrameworkLoaded !== true) {
            console.log("onDeviceReady() : FORCE RELOAD");
            location.reload();  // Reloads the index.html page, and doesn't reload the splashscreen
            return;
        }
    } catch (e) {
        console.warn("onDeviceReady : Error : " + e);
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM