Search code examples
iosxcodeionic-frameworkcordova-plugin-fcm

Ios App Crashing After Launching with Archived App Built file from Xcode9.2


I am building/deploying an Ionic app in Xcode.

ionic ios build

Above command went well.

And built from Xcode 9.2 and ran archive as well. I was been launching the app from archive file to iPhone. The app was opening, but it was crashing after it opens up.

Cordova Plugins List

cordova-android-play-services-gradle-release 1.1.4 "cordova-android-play-services-gradle-release"
cordova-plugin-admobpro 2.31.1 "AdMob Plugin Pro"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-extension 1.5.4 "Cordova Plugin Extension"
cordova-plugin-facebook4 1.7.4 "Facebook Connect"
cordova-plugin-fcm 2.1.2 "FCMPlugin"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-googleplus 5.1.1 "Google SignIn"
cordova-plugin-network-information 1.3.4 "Network Information"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-stripe 1.5.3 "cordova-plugin-stripe"
cordova-plugin-whitelist 1.3.1 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"

Crash logs

Incident Identifier: B5B0789F-48B9-4845-ACA8-43A90D105BDA
CrashReporter Key:   390906223b2bbe37cb9fee42cb41ec3f37ef09f6
Hardware Model:      iPhone8,1
Process:             MyHybridApp [3620]
Path:                /private/var/containers/Bundle/Application/E1DB741B-4662-4E7E-AF17-E9382E682B69/MyHybridApp.app/MyHybridApp
Identifier:          com.ionicframework.myhybridapp
Version:             1.4 (1.4)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.ionicframework.myhybridapp [1730]


Date/Time:           2018-02-09 15:49:29.3237 +0530
Launch Time:         2018-02-09 15:49:28.7265 +0530
OS Version:          iPhone OS 11.2.5 (15D60)
Baseband Version:    4.30.02
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
abort() called

Filtered syslog:
None found

Last Exception Backtrace:
0   CoreFoundation                  0x18121b164 __exceptionPreprocess + 124
1   libobjc.A.dylib                 0x180464528 objc_exception_throw + 55
2   CoreFoundation                  0x18121b0ac +[NSException raise:format:] + 115
3   MyHybridApp                     0x104354ab0 0x104108000 + 2411184
4   MyHybridApp                     0x104354058 0x104108000 + 2408536
5   MyHybridApp                     0x104353d80 0x104108000 + 2407808
6   MyHybridApp                     0x10411da28 0x104108000 + 88616
7   UIKit                           0x18a8442c4 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 383
8   UIKit                           0x18aa35bc4 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3435
9   UIKit                           0x18aa3aa14 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1711
10  UIKit                           0x18acd62a8 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 799
11  UIKit                           0x18afae100 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 159
12  UIKit                           0x18acd5f0c -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 251
13  UIKit                           0x18acd676c -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 731
14  UIKit                           0x18b45b7c0 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 259
15  UIKit                           0x18b45b664 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 447
16  UIKit                           0x18b1c92cc __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 219
17  UIKit                           0x18b3623cc _performActionsWithDelayForTransitionContext + 111
18  UIKit                           0x18b1c917c -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 251
19  UIKit                           0x18afad760 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 363
20  UIKit                           0x18aa39158 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 539
21  UIKit                           0x18ae4edbc -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 363
22  FrontBoardServices              0x1838de1f0 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 363
23  FrontBoardServices              0x1838e6af8 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 223
24  libdispatch.dylib               0x180b9aa14 _dispatch_client_callout + 15
25  libdispatch.dylib               0x180ba2200 _dispatch_block_invoke_direct$VARIANT$mp + 287
26  FrontBoardServices              0x1839127f8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 35
27  FrontBoardServices              0x18391249c -[FBSSerialQueue _performNext] + 403
28  FrontBoardServices              0x183912a38 -[FBSSerialQueue _performNextFromRunLoopSource] + 55
29  CoreFoundation                  0x1811c377c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 23
30  CoreFoundation                  0x1811c36fc __CFRunLoopDoSource0 + 87
31  CoreFoundation                  0x1811c2f84 __CFRunLoopDoSources0 + 203
32  CoreFoundation                  0x1811c0b5c __CFRunLoopRun + 1047
33  CoreFoundation                  0x1810e0c58 CFRunLoopRunSpecific + 435
34  GraphicsServices                0x182f8cf84 GSEventRunModal + 99
35  UIKit                           0x18a8395c4 UIApplicationMain + 235
36  MyHybridApp                     0x10410ca08 0x104108000 + 18952
37  libdyld.dylib                   0x180c0056c start + 3


Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x0000000180d302e8 __pthread_kill + 8
1   libsystem_pthread.dylib         0x0000000180e452f8 pthread_kill$VARIANT$mp + 396
2   libsystem_c.dylib               0x0000000180c9efbc abort + 140
3   libc++abi.dylib                 0x000000018043c068 __cxa_bad_cast + 0
4   libc++abi.dylib                 0x000000018043c210 default_unexpected_handler+ 8720 () + 0
5   libobjc.A.dylib                 0x0000000180464810 _objc_terminate+ 34832 () + 124
6   libc++abi.dylib                 0x000000018045454c std::__terminate(void (*)+ 107852 ()) + 16
7   libc++abi.dylib                 0x00000001804545b8 std::terminate+ 107960 () + 60
8   libdispatch.dylib               0x0000000180b9aa28 _dispatch_client_callout + 36
9   libdispatch.dylib               0x0000000180ba2200 _dispatch_block_invoke_direct$VARIANT$mp + 288
10  FrontBoardServices              0x00000001839127f8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36
11  FrontBoardServices              0x000000018391249c -[FBSSerialQueue _performNext] + 404
12  FrontBoardServices              0x0000000183912a38 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
13  CoreFoundation                  0x00000001811c377c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
14  CoreFoundation                  0x00000001811c36fc __CFRunLoopDoSource0 + 88
15  CoreFoundation                  0x00000001811c2f84 __CFRunLoopDoSources0 + 204
16  CoreFoundation                  0x00000001811c0b5c __CFRunLoopRun + 1048
17  CoreFoundation                  0x00000001810e0c58 CFRunLoopRunSpecific + 436
18  GraphicsServices                0x0000000182f8cf84 GSEventRunModal + 100
19  UIKit                           0x000000018a8395c4 UIApplicationMain + 236
20  MyHybridApp                     0x000000010410ca08 0x104108000 + 18952
21  libdyld.dylib                   0x0000000180c0056c start + 4

Thread 1:
0   libsystem_kernel.dylib          0x0000000180d30d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000180e42eec _pthread_wqthread + 884
2   libsystem_pthread.dylib         0x0000000180e42b6c start_wqthread + 4

Thread 2:
0   libsystem_kernel.dylib          0x0000000180d30d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000180e42eec _pthread_wqthread + 884
2   libsystem_pthread.dylib         0x0000000180e42b6c start_wqthread + 4

Thread 3 name:  com.apple.uikit.eventfetch-thread
Thread 3:
0   libsystem_kernel.dylib          0x0000000180d0f568 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000180d0f3e0 mach_msg + 72
2   CoreFoundation                  0x00000001811c3108 __CFRunLoopServiceMachPort + 196
3   CoreFoundation                  0x00000001811c0cd4 __CFRunLoopRun + 1424
4   CoreFoundation                  0x00000001810e0c58 CFRunLoopRunSpecific + 436
5   Foundation                      0x0000000181b15594 -[NSRunLoop+ 50580 (NSRunLoop) runMode:beforeDate:] + 304
6   Foundation                      0x0000000181b349ac -[NSRunLoop+ 178604 (NSRunLoop) runUntilDate:] + 96
7   UIKit                           0x000000018b3a37a8 -[UIEventFetcher threadMain] + 136
8   Foundation                      0x0000000181c170f4 __NSThread__start__ + 996
9   libsystem_pthread.dylib         0x0000000180e442b4 _pthread_body + 308
10  libsystem_pthread.dylib         0x0000000180e44180 _pthread_body + 0
11  libsystem_pthread.dylib         0x0000000180e42b74 thread_start + 4

Thread 4:
0   libsystem_pthread.dylib         0x0000000180e42b68 start_wqthread + 0

Thread 5:
0   libsystem_kernel.dylib          0x0000000180d300f0 __psynch_cvwait + 8
1   libsystem_pthread.dylib         0x0000000180e46ce4 _pthread_cond_wait$VARIANT$mp + 640
2   libc++.1.dylib                  0x00000001803e7f34 std::__1::condition_variable::__do_timed_wait+ 32564 (std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 96
3   JavaScriptCore                  0x0000000188589168 std::__1::cv_status std::__1::condition_variable::wait_until<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >+ 10133864 (std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > > const&) + 124
4   JavaScriptCore                  0x000000018858903c std::__1::cv_status std::__1::condition_variable_any::wait_until<std::__1::unique_lock<bmalloc::Mutex>, std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >+ 10133564 (std::__1::unique_lock<bmalloc::Mutex>&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > > const&) + 108
5   JavaScriptCore                  0x0000000188588ec0 bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::threadRunLoop+ 10133184 () + 280
6   JavaScriptCore                  0x00000001885891b8 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*), bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*> >+ 10133944 (void*) + 44
7   libsystem_pthread.dylib         0x0000000180e442b4 _pthread_body + 308
8   libsystem_pthread.dylib         0x0000000180e44180 _pthread_body + 0
9   libsystem_pthread.dylib         0x0000000180e42b74 thread_start + 4

Can you please check with the error. I am using xcode 9.2 , [email protected] , [email protected]


Solution

  • Let's assume that you've already set all the requirements of push notification correctly from your apple developer account page.

    If everything goes well after commenting out FCM related code, then I suppose your project probably missing GoogleService-Info.plist file. The .plist file doesn’t magically go to the right place properly in your iOS folder. It goes in malformed.

    You’ll need to manually copy it from the project’s root folder to the Resources folder in Xcode. Also, this has to happen every time you remove and re-add your iOS app. Which is a very troublesome task to do. To solve this tedious issue, I do the following.

    Since Cordova CLI 7.x.x, when using cordova-android 6.2.x or cordova-ios 4.4.x you can use the resource-file tag from config.xml.

    For example,

    <platform name="ios">
      <resource-file src="GoogleService-Info.plist" />
    </platform>
    

    It will include GoogleService-Info.plist file into the Resource folder during ionic cordova build ios.

    I hope this helps you solve the crashing issue.