簡體   English   中英

iOS 科爾多瓦應用程序在閃屏后掛起

[英]iOS cordova app hangs after splash screen

我正在編譯我的應用程序的新版本,在設備和模擬器上的啟動畫面之后,屏幕只是空白。 我構建的應用程序的最后一個版本運行良好……當前版本在 Android 設備上運行良好。 下面的日志與應用程序啟動時沒有問題時幾乎相同,所以我不知道是什么導致了這個 WOD。 我該如何解決這個問題? 我還能如何獲得有關屏幕掛起原因的真實日志?

在 Safari Inspector 中,我可以看到整個應用程序的 html 加載看起來很好......似乎一切都在那里。 同樣,控制台日志中報告的 JS/AngularJS 錯誤為零。

我添加了一些 console.logs 以查看我是否可以查明事情至少到達的位置,但甚至無法在 Xcode 或 Safari 檢查器中打印到控制台。

這是我的環境:

離子信息

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

和控制台日志,我不相信以下任何錯誤/警告應該導致應用程序掛起或白屏 - 我之前已經看過所有這些,但沒有一個影響應用程序。 大多數我已經研究過並且看起來是良性的。

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

我曾經在 Cordova 的應用程序中遇到過類似的問題(使用 ExtJS 框架編寫,而不是 Ionic),應用程序會在啟動畫面后掛起,主要是在 iOS 上。

問題

Cordova 加載良好,但框架卻沒有。 (出於未知原因)因此,加載了index.html並觸發了deviceready事件,但框架為空且無法啟動。

解決方法

我從來沒有找到問題的根源(我懷疑它與你的無關),但是由於deviceready被觸發,我在運行時檢查框架是否已加載,如果沒有,則重新加載整個應用程序。 對於用戶點視圖,啟動畫面只出現一次,然后消失,屏幕保持白色(當應用程序在后台重新加載時),然后應用程序出現。

在我的index.html ,類似的東西

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);
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM