Search code examples
iosxcodeibm-mobilefirst

App crashes upon launch


I submitted my app to the app store but it got rejected it was crashing at the startup. Below are the crash logs:

{"app_name":"my app","timestamp":"2016-10-14 11:23:40.71 -0700","app_version":"3.7","slice_uuid":"d7f7e7c6-eedf-34d3-87a4-f20da6f38209","adam_id":0,"build_version":"1.5.3","bundleID":"com.mycompany","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 10.0.2 (14A456)","incident_id":"73C54050-9529-407C-9323-C5C609A2EB7F","name":"my app"}
Incident Identifier: 73C54050-9529-407C-9323-C5C609A2EB7F
CrashReporter Key:   2c0ba505c2c6082ea09a6f57e4d847f80be99b41
Hardware Model:      xxx
Process:             my app [330]
Path:                /private/var/containers/Bundle/Application/B7F24EF4-8716-484F-A83A-20CCCCDCFA3A/my app.app/my app
Identifier:          com.mycompany
Version:             1.5.3 (3.7)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.mycompany [404]


Date/Time:           2016-10-14 11:23:40.5372 -0700
Launch Time:         2016-10-14 11:23:40.4466 -0700
OS Version:          iPhone OS 10.0.2 (14A456)
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Description: DYLD, Library not loaded: @rpath/IBMMobileFirstPlatformFoundation.framework/IBMMobileFirstPlatformFoundation | Referenced from: /var/containers/Bundle/Application/B7F24EF4-8716-484F-A83A-20CCCCDCFA3A/my app.app/my app | Reason: image not found
Triggered by Thread:  0

Filtered syslog:
None found

Thread 0 Crashed:
0   dyld                            0x0000000100361cd8 0x10033c000 + 154840
1   dyld                            0x0000000100361668 0x10033c000 + 153192
2   dyld                            0x00000001003616b0 0x10033c000 + 153264
3   dyld                            0x0000000100340514 0x10033c000 + 17684
4   dyld                            0x00000001003429a8 0x10033c000 + 27048
5   dyld                            0x000000010033d044 0x10033c000 + 4164

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000006   x1: 0x0000000000000001   x2: 0x000000016fd221b0   x3: 0x00000000000000c7
    x4: 0x000000016fd21db0   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x00000000000001d0
    x8: 0x0000000000000020   x9: 0x0000000000000009  x10: 0x67616d69203a6e6f  x11: 0x6f6620746f6e2065
   x12: 0x20200a495520656c  x13: 0x203a6e6f73616552  x14: 0x6f6e206567616d69  x15: 0x00646e756f662074
   x16: 0x0000000000000209  x17: 0x0000000000000010  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x000000016fd21db0  x21: 0x00000000000000c7  x22: 0x000000016fd221b0  x23: 0x0000000000000001
   x24: 0x0000000000000006  x25: 0x000000010036dab8  x26: 0x000000010036fbb8  x27: 0xe6afae36b31a0072
   x28: 0x000000010036d000   fp: 0x000000016fd21d80   lr: 0x0000000100361668
    sp: 0x000000016fd21d40   pc: 0x0000000100361cd8 cpsr: 0x00000000

Binary Images:
0x1000dc000 - 0x100263fff my app arm64  <d7f7e7c6eedf34d387a4f20da6f38209> /var/containers/Bundle/Application/B7F24EF4-8716-484F-A83A-20CCCCDCFA3A/my app.app/my app
0x10033c000 - 0x10036bfff dyld arm64  <fc8715469f7b30228b67a5ae12cadf10> /usr/lib/dyld

EOF

The termination description says that :

Termination Description: DYLD, Library not loaded: @rpath/IBMMobileFirstPlatformFoundation.framework/IBMMobileFirstPlatformFoundation | Referenced from: /var/containers/Bundle/Application/B7F24EF4-8716-484F-A83A-20CCCCDCFA3A/my app.app/my app | Reason: image not found
Triggered by Thread:  0

I am using XCode 8 and iOS 10 to test my app. When I am installing it through the XCode, then it is working fine. This crash is only coming if I install the .ipa file either from iTunes or TestFlight or ApplicationCenter.

Following plugins are installed in the app:

  1. cordova-plugin-console 1.0.4 "Console"

  2. cordova-plugin-device 1.1.3 "Device"

  3. cordova-plugin-dialogs 1.3.0 "Notification"

  4. cordova-plugin-globalization 1.0.4 "Globalization"

  5. cordova-plugin-mfp 8.0.2016080320 "IBM MobileFirst Platform Foundation"

  6. cordova-plugin-okhttp 2.0.0 "OkHttp"

  7. cordova-plugin-splashscreen 4.0.0 "Splashscreen"

  8. cordova-plugin-statusbar 2.2.0 "StatusBar"

  9. cordova-plugin-whitelist 1.3.0 "Whitelist"

When I am validating the app after archiving it, I am getting below erro:

enter image description here


Solution

  • IBMMobilefirstPlatformFoundation.framework is packaged with i386 and x86_64 architecture slices so that applications with these framework added can be run on simulators as well. But these architectures in dynamic libraries are unsupported while submitting to AppStore/Generating Archive. This is a reported Xcode defect which you can find here.

    Present workaround is to remove those architectures from IBMMobilefirstPlatformFoundation.framework while submitting to AppStore/Generating Archive. This blog describes the same issues and contains a script using which one can strip off unwanted architectures ( i386 / x86_64) from dynamic libraries.