Core Data Exception coerceValueForKeyWithDescription - ios

I'm having trouble fixing a non-reproducible crash that's only appearing on a couple user devices. The exception is raised while changing the properties of a Core Data managed object, and then saving those changes. The users report that their changes are not persisted next time they open the app after the crash. Here is the crash log up to the binary images:
Hardware Model: iPhone12,5
Process: Pupl [25152]
Path: /private/var/containers/Bundle/Application/E75455E2-43A9-4C5C-BEFF-3E64F5046322/Pupl.app/Pupl
Identifier: com.kevinolmats.Pupl
Version: 285 (1.0.1)
AppStoreTools: 12A7402a
AppVariant: 1:iPhone12,5:14
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.kevinolmats.Pupl [1530]
Date/Time: 2020-10-25 09:57:57.2646 -0600
Launch Time: 2020-10-25 09:48:56.9577 -0600
OS Version: iPhone OS 14.0.1 (18A393)
Release Type: User
Baseband Version: 2.00.01
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x1935665ac __exceptionPreprocess + 220 (NSException.m:199)
1 libobjc.A.dylib 0x1a75e042c objc_exception_throw + 60 (objc-exception.mm:565)
2 CoreData 0x19961a648 _PFManagedObject_coerceValueForKeyWithDescription + 2004 (NSManagedObject.m:0)
3 CoreData 0x19961f6f4 _sharedIMPL_setvfk_core + 192 (NSManagedObject_Accessors.m:1412)
4 Pupl 0x100d96cac specialized WeightCategoryEditorViewModel.init(course:color:context:) + 596 (WeightCategoryEditorViewModel.swift:30)
5 Pupl 0x100d8d7a0 0x100d44000 + 300960
6 SwiftUI 0x199ed30b0 partial apply for implicit closure #2 in implicit closure #1 in DefaultListButtonStyle.ListButton.body.getter + 28 (PrimitiveButtonStyle.swift:47)
7 SwiftUI 0x199ddb9c4 thunk for #escaping #callee_guaranteed () -> () + 28 (<compiler-generated>:0)
8 SwiftUI 0x199e60e90 specialized closure #2 in PlatformItemList.containerSelectionBehavior.getter + 68 (<compiler-generated>:0)
9 SwiftUI 0x199efb3f8 ListCoreCoordinator.tableView(_:didSelectRowAt:) + 908 (ListCore_PhoneTV.swift:1250)
10 SwiftUI 0x199efb6e4 #objc ListCoreCoordinator.tableView(_:willBeginEditingRowAt:) + 136
11 UIKitCore 0x1960860d0 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:isCellMultiSelect:] + 1064 (UITableView.m:8278)
12 UIKitCore 0x196085c8c -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 112 (UITableView.m:8192)
13 UIKitCore 0x196086438 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 272 (UITableView.m:8317)
14 UIKitCore 0x19634b544 -[_UIAfterCACommitBlock run] + 72 (_UIAfterCACommitQueue.m:122)
15 UIKitCore 0x195e90400 _runAfterCACommitDeferredBlocks + 300 (UIApplication.m:2924)
16 UIKitCore 0x195e7f1bc _cleanUpAfterCAFlushAndRunDeferredBlocks + 204 (UIApplication.m:2902)
17 UIKitCore 0x195eb2648 _afterCACommitHandler + 80 (UIApplication.m:2958)
18 CoreFoundation 0x1934e2444 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 (CFRunLoop.c:1799)
19 CoreFoundation 0x1934dc858 __CFRunLoopDoObservers + 576 (CFRunLoop.c:1912)
20 CoreFoundation 0x1934dce08 __CFRunLoopRun + 1056 (CFRunLoop.c:2953)
21 CoreFoundation 0x1934dc4bc CFRunLoopRunSpecific + 600 (CFRunLoop.c:3242)
22 GraphicsServices 0x1a9f61820 GSEventRunModal + 164 (GSEvent.c:2259)
23 UIKitCore 0x195e80734 -[UIApplication _run] + 1072 (UIApplication.m:3270)
24 UIKitCore 0x195e85e10 UIApplicationMain + 168 (UIApplication.m:4739)
25 SwiftUI 0x19a23d32c closure #1 in KitRendererCommon(_:) + 112 (UIKitApp.swift:34)
26 SwiftUI 0x19a23d2b8 runApp<A>(_:) + 220 (<compiler-generated>:0)
27 SwiftUI 0x199db6b08 static App.main() + 140 (App.swift:113)
28 Pupl 0x100d5311c $main + 56 (Assignment.swift:0)
29 Pupl 0x100d5311c main + 68
30 libdyld.dylib 0x1931a3e60 start + 4
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001bf49798c __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001daabfc74 pthread_kill + 272 (pthread.c:1375)
2 libsystem_c.dylib 0x000000019c668bb4 abort + 104 (abort.c:110)
3 libc++abi.dylib 0x00000001a76dfe24 abort_message + 132 (abort_message.cpp:76)
4 libc++abi.dylib 0x00000001a76d1434 demangling_terminate_handler() + 308 (cxa_default_handlers.cpp:67)
5 libobjc.A.dylib 0x00000001a75e0710 _objc_terminate() + 132 (objc-exception.mm:701)
6 libc++abi.dylib 0x00000001a76df2a8 std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59)
7 libc++abi.dylib 0x00000001a76e2174 __cxa_rethrow + 148 (cxa_exception.cpp:617)
8 libobjc.A.dylib 0x00000001a75e05ec objc_exception_rethrow + 44 (objc-exception.mm:604)
9 CoreFoundation 0x00000001934dc5a8 CFRunLoopRunSpecific + 836 (CFRunLoop.c:3257)
10 GraphicsServices 0x00000001a9f61820 GSEventRunModal + 164 (GSEvent.c:2259)
11 UIKitCore 0x0000000195e80734 -[UIApplication _run] + 1072 (UIApplication.m:3270)
12 UIKitCore 0x0000000195e85e10 UIApplicationMain + 168 (UIApplication.m:4739)
13 SwiftUI 0x000000019a23d32c closure #1 in KitRendererCommon(_:) + 112 (UIKitApp.swift:34)
14 SwiftUI 0x000000019a23d2b8 runApp<A>(_:) + 220 (<compiler-generated>:0)
15 SwiftUI 0x0000000199db6b08 static App.main() + 140 (App.swift:113)
16 Pupl 0x0000000100d5311c $main + 56 (Assignment.swift:0)
17 Pupl 0x0000000100d5311c main + 68
18 libdyld.dylib 0x00000001931a3e60 start + 4
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000
x4: 0x000000016f0bad10 x5: 0x000000016f0bb2c0 x6: 0x000000000000006e x7: 0x0000000000000700
x8: 0x00000000000005b9 x9: 0x0d58175f700a1725 x10: 0x0000000000000002 x11: 0x0000000000000003
x12: 0x0000000000000000 x13: 0x0000000000000001 x14: 0x0000000000000010 x15: 0x0000000000000046
x16: 0x0000000000000148 x17: 0x00000001010838c0 x18: 0x000000010b9b6d8c x19: 0x0000000000000006
x20: 0x0000000000000407 x21: 0x00000001010839a0 x22: 0x0000000000000001 x23: 0x00000002835989d0
x24: 0x0000000000000000 x25: 0x0000000000000001 x26: 0x0000000eb1e31100 x27: 0x00000001e70b3000
x28: 0x0000000000000001 fp: 0x000000016f0bb220 lr: 0x00000001daabfc74
sp: 0x000000016f0bb200 pc: 0x00000001bf49798c cpsr: 0x40000000
esr: 0x56000080 Address size fault
Note the WeightCategoryEditorViewModel.init on frame 4. This is the frame that changes between crash logs, but the subsequent frames are the same. Here's the init for the WeightCategoryEditorViewModel:
/// Creates a new model which edits the given weight category.
init(weightCategory: WeightCategory, color: Color = .accentColor, context: NSManagedObjectContext) {
self.context = context
self.weightCategory = weightCategory
self.accentColor = color
self.isEditing = true
self.name = weightCategory.name
self.weight = String(format: "%.0f", weightCategory.weight)
}
Anyone know what my next steps should be?

Related

What's the reason of the crash of iOS app? Here are the crash logs

I've tried several devices, and no one crashes, but when I sent my build to Apple Review, they rejected it because it crashes on launch.
The first time that the app is launched, a view presents modally asking for some user preferences, and asking for allowing the legal documents. Every other time the app is launched, it displays a tab view controller.
I already Symbolicated the Crash Report
The crash logs:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Application Specific Information:
abort() called
Last Exception Backtrace:
0 CoreFoundation 0x18711586c __exceptionPreprocess + 220
1 libobjc.A.dylib 0x19c12ec50 objc_exception_throw + 59
2 CoreFoundation 0x18701d5c8 -[NSException raise] + 15
3 Foundation 0x18835ff58 -[NSObject+ 192344 (NSKeyValueCoding) setValue:forKey:] + 327
4 UIKitCore 0x18939edd8 -[UIViewController setValue:forKey:] + 95
5 UIKitCore 0x1896dbfa4 -[UIRuntimeOutletConnection connect] + 127
6 CoreFoundation 0x186ff50c8 -[NSArray makeObjectsPerformSelector:] + 251
7 UIKitCore 0x1896d7d6c -[UINib instantiateWithOwner:options:] + 1903
8 UIKitCore 0x1893a68c0 -[UIViewController loadView] + 591
9 UIKitCore 0x189395f24 -[UITableViewController loadView] + 99
10 UIKitCore 0x1893a6c7c -[UIViewController loadViewIfRequired] + 199
11 UIKitCore 0x1892e5a08 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 175
12 UIKitCore 0x1892e5d24 -[UINavigationController _startTransition:fromViewController:toViewController:] + 195
13 UIKitCore 0x1892e6bac -[UINavigationController _startDeferredTransitionIfNeeded:] + 879
14 UIKitCore 0x1892e7f88 -[UINavigationController __viewWillLayoutSubviews] + 167
15 UIKitCore 0x1892c9a18 -[UILayoutContainerView layoutSubviews] + 227
16 UIKitCore 0x18a017ec4 -[UIView+ 17915588 (CALayerDelegate) layoutSublayersOfLayer:] + 2503
17 QuartzCore 0x18a532644 -[CALayer layoutSublayers] + 307
18 QuartzCore 0x18a532b18 CA::Layer::layout_if_needed+ 1440536 (CA::Transaction*) + 523
19 QuartzCore 0x18a54730c CA::Layer::layout_and_display_if_needed+ 1524492 (CA::Transaction*) + 143
20 QuartzCore 0x18a48c640 CA::Context::commit_transaction+ 759360 (CA::Transaction*, double, double*) + 415
21 QuartzCore 0x18a4b7b08 CA::Transaction::commit+ 936712 () + 731
22 UIKitCore 0x189ae9f28 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 83
23 CoreFoundation 0x18709149c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 27
24 CoreFoundation 0x1870906e4 __CFRunLoopDoBlocks + 407
25 CoreFoundation 0x18708aaa0 __CFRunLoopRun + 843
26 CoreFoundation 0x18708a21c CFRunLoopRunSpecific + 599
27 GraphicsServices 0x19ec54784 GSEventRunModal + 163
28 UIKitCore 0x189acaee8 -[UIApplication _run] + 1071
29 UIKitCore 0x189ad075c UIApplicationMain + 167
30 Drone License Quiz 0x1048dc3ec 0x1048cc000 + 66540
31 libdyld.dylib 0x186d4a6b0 start + 3
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001b5065414 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001d2bc0b50 pthread_kill + 272
2 libsystem_c.dylib 0x0000000190543bf4 __abort + 116
3 libsystem_c.dylib 0x0000000190543b80 __abort + 0
4 libc++abi.dylib 0x000000019c234cf8 __cxxabiv1::__aligned_malloc_with_fallback+ 81144 (unsigned long) + 0
5 libc++abi.dylib 0x000000019c225e4c demangling_unexpected_handler+ 20044 () + 0
6 libobjc.A.dylib 0x000000019c12ef64 _objc_terminate+ 28516 () + 144
7 libc++abi.dylib 0x000000019c2340e0 std::__terminate(void (*)+ 78048 ()) + 20
8 libc++abi.dylib 0x000000019c237150 __cxa_rethrow + 148
9 libobjc.A.dylib 0x000000019c12ee1c objc_exception_rethrow + 44
10 CoreFoundation 0x000000018708a308 CFRunLoopRunSpecific + 836
11 GraphicsServices 0x000000019ec54784 GSEventRunModal + 164
12 UIKitCore 0x0000000189acaee8 -[UIApplication _run] + 1072
13 UIKitCore 0x0000000189ad075c UIApplicationMain + 168
14 Drone License Quiz 0x00000001048dc3ec 0x1048cc000 + 66540
15 libdyld.dylib 0x0000000186d4a6b0 start + 4
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000
x4: 0x0000000000000000 x5: 0x0000000000989680 x6: 0x000000000000006e x7: 0x0000000000000e00
x8: 0x00000000000005b9 x9: 0x3f4aa2f53b055c8b x10: 0x00000000000003e8 x11: 0x0000000000000003
x12: 0x0000000000000000 x13: 0x0000000000000001 x14: 0x0000000000000010 x15: 0x0000000000000066
x16: 0x0000000000000148 x17: 0x00000001050438c0 x18: 0x0000000000000000 x19: 0x0000000000000006
x20: 0x0000000000000407 x21: 0x00000001050439a0 x22: 0x0000000000000001 x23: 0x00000002829d8010
x24: 0x0000000000000000 x25: 0x0000000000000001 x26: 0x0000000eb1e31100 x27: 0x00000001e9f64000
x28: 0x0000000000000001 fp: 0x000000016b5332d0 lr: 0x00000001d2bc0b50
sp: 0x000000016b5332b0 pc: 0x00000001b5065414 cpsr: 0x40000000
esr: 0x56000080 Address size fault

My app Crashes in Testflight on iOS 13+ Only

I recently submitted an app to Tesflight for test, the app work fine for iOS 12 but consistently crashes at the same place for iOS 13.6.1 .
The app is in Testflight and is compiled with Xcode 11.5
Can anyone help me to solve this problem?
this is crash log can anyone make a suggestion on what's going wrong ?
Incident Identifier: A516654B-34B8-411D-B6D5-12BEC3B9D2CE
Hardware Model: iPhone9,3
Process: ********* [3921]
Path: /private/var/containers/Bundle/Application/******
Identifier: com.*****
Version: 3 (1.0.1)
AppStoreTools: 11E801a
AppVariant: 1:iPhone9,3:13
Beta: YES
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.******* [1594]
Date/Time: 2020-08-29 20:30:02.3612 +0200
Launch Time: 2020-08-29 20:29:50.4227 +0200
OS Version: iPhone OS 13.6.1 (17G80)
Release Type: User
Baseband Version: 4.03.00
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 2
Last Exception Backtrace:
0 CoreFoundation 0x199c79654 __exceptionPreprocess + 224 (NSException.m:199)
1 libobjc.A.dylib 0x19999bbcc objc_exception_throw + 56 (objc-exception.mm:565)
2 CoreFoundation 0x199b7c6ec +[NSException raise:format:arguments:] + 96 (NSException.m:146)
3 Foundation 0x199fc216c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 128 (NSException.m:231)
4 FrontBoardServices 0x19ee48e84 -[FBSSerialQueue assertOnQueue] + 228 (FBSSerialQueue.m:98)
5 FrontBoardServices 0x19edfed88 -[FBSSceneImpl updateClientSettings:withTransitionContext:] + 76 (FBSSceneImpl.m:190)
6 FrontBoardServices 0x19edfefe8 -[FBSSceneImpl updateClientSettingsWithTransitionBlock:] + 152 (FBSSceneImpl.m:213)
7 FrontBoardServices 0x19edfeef8 -[FBSSceneImpl updateClientSettingsWithBlock:] + 112 (FBSSceneImpl.m:203)
8 UIKitCore 0x19d8a46c0 -[FBSScene(UIApp) updateUIClientSettingsWithBlock:] + 168 (FBSScene+UIApp.m:41)
9 UIKitCore 0x19dd3c448 -[UIApplication setProximityEventsEnabled:] + 108 (UIApplication.m:9203)
10 UIKitCore 0x19d99cd50 -[UIDevice setProximityMonitoringEnabled:] + 112 (UIDevice.m:890)
11 *** 0x100276cec -[ProximityHelper startProximitySensor] + 100 (ProximityHelper.m:53)
12 *** 0x10025347c -[RecordSound performRecord:] + 656 (RecordSound.m:172)
13 *** 0x10009c180 -[SoundRecordManager startCalibrationRecord:] + 200 (SoundRecordManager.m:65)
14 CoreFoundation 0x199c7f8c0 __invoking___ + 144
15 CoreFoundation 0x199b50a70 -[NSInvocation invoke] + 300 (NSForwarding.m:3312)
16 CoreFoundation 0x199b51648 -[NSInvocation invokeWithTarget:] + 76 (NSForwarding.m:3418)
17 **** 0x10015bef0 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 460 (RCTModuleMethod.mm:584)
18 **** 0x10015dfdc facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&) + 244 (RCTNativeModule.mm:114)
19 **** 0x10015dd40 operator() + 44 (RCTNativeModule.mm:75)
20 **** 0x10015dd40 invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 88 (RCTNativeModule.mm:67)
21 libdispatch.dylib 0x19993e9a8 _dispatch_call_block_and_release + 24 (init.c:1408)
22 libdispatch.dylib 0x19993f524 _dispatch_client_callout + 16 (object.m:495)
23 libdispatch.dylib 0x1998eb8a4 _dispatch_lane_serial_drain$VARIANT$mp + 608 (inline_internal.h:2484)
24 libdispatch.dylib 0x1998ec294 _dispatch_lane_invoke$VARIANT$mp + 416 (queue.c:3863)
25 libdispatch.dylib 0x1998f578c _dispatch_workloop_worker_thread + 588 (queue.c:6445)
26 libsystem_pthread.dylib 0x199990b74 _pthread_wqthread + 272 (pthread.c:2351)
27 libsystem_pthread.dylib 0x199993740 start_wqthread + 8
Thread 2 name:
Thread 2 Crashed:
0 libsystem_kernel.dylib 0x0000000199a6ed88 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001999871e8 pthread_kill$VARIANT$mp + 136 (pthread.c:1458)
2 libsystem_c.dylib 0x00000001998da934 abort + 100 (abort.c:110)
3 libc++abi.dylib 0x0000000199a42cc0 abort_message + 128 (abort_message.cpp:76)
4 libc++abi.dylib 0x0000000199a34e10 demangling_terminate_handler() + 296 (cxa_default_handlers.cpp:65)
5 libobjc.A.dylib 0x000000019999be80 _objc_terminate() + 124 (objc-exception.mm:701)
6 libc++abi.dylib 0x0000000199a4214c std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:59)
7 libc++abi.dylib 0x0000000199a420e4 std::terminate() + 44 (cxa_handlers.cpp:88)
8 libdispatch.dylib 0x000000019993f538 _dispatch_client_callout + 36 (object.m:498)
9 libdispatch.dylib 0x00000001998eb8a4 _dispatch_lane_serial_drain$VARIANT$mp + 608 (inline_internal.h:2484)
10 libdispatch.dylib 0x00000001998ec294 _dispatch_lane_invoke$VARIANT$mp + 416 (queue.c:3863)
11 libdispatch.dylib 0x00000001998f578c _dispatch_workloop_worker_thread + 588 (queue.c:6445)
12 libsystem_pthread.dylib 0x0000000199990b74 _pthread_wqthread + 272 (pthread.c:2351)
13 libsystem_pthread.dylib 0x0000000199993740 start_wqthread + 8
Thread 2 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000
x4: 0x0000000199a45f29 x5: 0x000000016ff0a450 x6: 0x000000000000006e x7: 0xffffffffffffffec
x8: 0x000000016ff0b000 x9: 0x32fb60d336d77b95 x10: 0x0000000199987160 x11: 0x000000000000000b
x12: 0x00000001d55f9080 x13: 0x0000000000000001 x14: 0x0000000000000010 x15: 0x0000000000000004
x16: 0x0000000000000148 x17: 0x0000000000000000 x18: 0x0000000000000000 x19: 0x0000000000000006
x20: 0x0000000000001803 x21: 0x000000016ff0a450 x22: 0x000000016ff0b0e0 x23: 0x0000000000000000
x24: 0x0000000000000000 x25: 0x0000000281d6a800 x26: 0x00000002826015c0 x27: 0x0000000000000000
x28: 0x00000002826015c0 fp: 0x000000016ff0a3b0 lr: 0x00000001999871e8
sp: 0x000000016ff0a390 pc: 0x0000000199a6ed88 cpsr: 0x40000000
esr: 0x56000080 Address size fault
the code of proximity helper :
49 - (void) startProximitySensor {
50 if (!self.activatedByApp) return;
51 [timesChanged removeAllObjects];
52 UIDevice *device = [UIDevice currentDevice];
53 device.proximityMonitoringEnabled = YES;
54
55
56 [[NSNotificationCenter defaultCenter]
57 addObserver:self
58 selector:#selector(proximityChanged:)
59 name: proximityNotificationString
60 object:nil];
61 }
In this app version, I don't need proximity helper so I deleted his call from the library and it worked on iOS 13+

Crash in production build only, EXC_BAD_ACCESS KERN_INVALID_ADDRESS

Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000
2 UIKitCore -[UIView traitCollection] + 176
This crash is only happening in production and on iOS 12 devices. The only line in the crash report that is part of my app is the AppDelegate class definition which obviously isn't helpful.
I have tried opening it up using the Crashes Organizer and it doesn't seem to know what to do when I hit "Open in Project". This crash is mostly happening in iOS 12 but have seen a couple instances on iOS 11.
Hardware Model: iPhone9,2
Version: 1 (4.2.1)
AppStoreTools: 10B63
AppVariant: 1:iPhone9,2:12
Code Type: ARM-64 (Native)
Role: Non UI
Parent Process: launchd [1]
Date/Time: 2018-12-31 22:15:33.6264 -0600
Launch Time: 2018-12-31 22:14:09.4376 -0600
OS Version: iPhone OS 12.1.2 (16C101)
Baseband Version: 5.30.00
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
VM Region Info: 0 is not in any region. Bytes before following region: 4374282240
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 0000000104ba4000-0000000104ba8000 [ 16K] r-x/r-x SM=COW ...p/MyApp
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [6155]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libobjc.A.dylib 0x000000019bad487c lookUpImpOrForward + 156 (objc-runtime-new.h:1269)
1 libobjc.A.dylib 0x000000019bad4870 lookUpImpOrForward + 144 (objc-runtime-new.mm:514)
2 libobjc.A.dylib 0x000000019bae1098 _objc_msgSend_uncached + 56
3 UIKitCore 0x00000001ca08e5a0 -[UIView traitCollection] + 176 (UIView.m:0)
4 UIKitCore 0x00000001c982ebdc -[UIGestureRecognizer _inForceCapableEnvironment] + 48 (UIGestureRecognizer.m:1667)
5 UIKitCore 0x00000001c982891c -[UIGestureRecognizer setView:] + 324 (UIGestureRecognizer.m:468)
6 UIKitCore 0x00000001c9832e34 -[UILongPressGestureRecognizer setView:] + 84 (UILongPressGestureRecognizer.m:186)
7 UIKitCore 0x00000001ca0b2770 -[UIView(Internal) _addGestureRecognizer:atEnd:] + 252 (UIView.m:14622)
8 UIKitCore 0x00000001c9ea87ec -[UITextInteraction didMoveToView:] + 252 (UITextInteraction.m:310)
9 UIKitCore 0x00000001ca0b5ff0 _setInteractionView + 84 (UIView.m:15244)
10 UIKitCore 0x00000001ca0b5ed4 -[UIView(Dragging) addInteraction:] + 208 (UIView.m:15260)
11 UIKitCore 0x00000001c9ea88bc -[UITextInteraction didMoveToView:] + 460 (UITextInteraction.m:314)
12 UIKitCore 0x00000001ca0b5ff0 _setInteractionView + 84 (UIView.m:15244)
13 UIKitCore 0x00000001ca0b5ed4 -[UIView(Dragging) addInteraction:] + 208 (UIView.m:15260)
14 UIKitCore 0x00000001c9ea88bc -[UITextInteraction didMoveToView:] + 460 (UITextInteraction.m:314)
15 UIKitCore 0x00000001ca0b5ff0 _setInteractionView + 84 (UIView.m:15244)
16 UIKitCore 0x00000001ca0b5ed4 -[UIView(Dragging) addInteraction:] + 208 (UIView.m:15260)
17 UIKitCore 0x00000001c9ea88bc -[UITextInteraction didMoveToView:] + 460 (UITextInteraction.m:314)
18 UIKitCore 0x00000001ca0b5ff0 _setInteractionView + 84 (UIView.m:15244)
19 UIKitCore 0x00000001ca0b5ed4 -[UIView(Dragging) addInteraction:] + 208 (UIView.m:15260)
20 UIKitCore 0x00000001c9ebfc74 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) addGestureRecognizersToView:] + 1192 (UITextInteractionAssistant.m:794)
21 UIKitCore 0x00000001c9ebf724 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) setGestureRecognizers] + 204 (UITextInteractionAssistant.m:0)
22 UIKitCore 0x00000001c9ebe1e8 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) initWithView:textInteractionSet:] + 124 (UITextInteractionAssistant.m:226)
23 UIKitCore 0x00000001c9f14924 -[UITextField _createInteractionAssistant] + 80 (UITextField.m:7609)
24 UIKitCore 0x00000001c9f149c0 -[UITextField willMoveToWindow:] + 132 (UITextField.m:7620)
25 UIKitCore 0x00000001ca0a0b18 -[UIView(Hierarchy) _willMoveToWindow:] + 804 (UIView.m:10262)
26 UIKitCore 0x00000001ca0b0f2c -[UIView(Internal) _addSubview:positioned:relativeTo:] + 424 (UIView.m:14253)
27 UIKitCore 0x00000001ca086a68 -[UIView _setTraitStorageSubviews:] + 548 (UIView.m:0)
28 Foundation 0x000000019d2a529c -[NSObject(NSKeyValueCoding) setValue:forKey:] + 272 (NSKeyValueCoding.m:418)
29 UIKitCore 0x00000001ca0b702c -[UIView(CALayerDelegate) setValue:forKey:] + 180 (UIView.m:15515)
30 UIKitCore 0x00000001c98ba6d4 -[NSObject(UIIBPrivate) _uikit_applyValueFromTraitStorage:forKeyPath:] + 60 (_UITraitStorage.m:39)
31 UIKitCore 0x00000001c98bc828 -[_UIRelationshipTraitStorage applyRecordsMatchingTraitCollection:] + 1220 (_UITraitStorage.m:395)
32 UIKitCore 0x00000001c98baec4 -[NSObject(_UITraitStorageAccessors) _applyTraitStorageRecordsForTraitCollection:] + 244 (_UITraitStorage.m:156)
33 UIKitCore 0x00000001ca08e9bc -[UIView _traitCollectionDidChangeInternal:] + 104 (UIView.m:5513)
34 UIKitCore 0x00000001ca08ecdc -[UIView _wrappedProcessTraitCollectionDidChange:forceNotification:] + 128 (UIView.m:5573)
35 UIKitCore 0x00000001c9ffa4e0 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateEx... + 116 (NSLayoutConstraint_UIKitAdditions.m:4172)
36 UIKitCore 0x00000001ca08efd0 -[UIView _processDidChangeRecursivelyFromOldTraits:toCurrentTraits:forceNotification:] + 132 (UIView.m:5604)
37 UIKitCore 0x00000001ca0b776c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1268 (UIView.m:15686)
38 QuartzCore 0x00000001a0ef5b74 -[CALayer layoutSublayers] + 184 (CALayer.mm:9445)
39 QuartzCore 0x00000001a0efab2c CA::Layer::layout_if_needed(CA::Transaction*) + 324 (CALayer.mm:9325)
40 QuartzCore 0x00000001a0e5944c CA::Context::commit_transaction(CA::Transaction*) + 340 (CALayer.mm:2463)
41 QuartzCore 0x00000001a0e87d7c CA::Transaction::commit() + 608 (CATransactionInternal.mm:425)
42 UIKitCore 0x00000001c9c37a3c _afterCACommitHandler + 256 (UIApplication.m:2782)
43 CoreFoundation 0x000000019c8887cc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1822)
44 CoreFoundation 0x000000019c883460 __CFRunLoopDoObservers + 412 (CFRunLoop.c:1932)
45 CoreFoundation 0x000000019c883a00 __CFRunLoopRun + 1264 (CFRunLoop.c:2950)
46 CoreFoundation 0x000000019c8831f0 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
47 GraphicsServices 0x000000019eafc584 GSEventRunModal + 100 (GSEvent.c:2245)
48 UIKitCore 0x00000001c9c0ed40 UIApplicationMain + 212 (UIApplication.m:4347)
49 MyApp 0x0000000104babe54 0x104ba4000 + 32340
50 libdyld.dylib 0x000000019c342bb4 start + 4
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000001 x1: 0x0000000104fa6e40 x2: 0x000000028388fcc0 x3: 0x0000000000000001
x4: 0x0000000000000000 x5: 0x0000000000000001 x6: 0x00000002812ba0a0 x7: 0x0000000000000d90
x8: 0x0000000000000000 x9: 0x2c49510395fc0044 x10: 0x0000000104f76998 x11: 0x0000000104c8b43c
x12: 0x0000000104f8f1f8 x13: 0x0000000104fa6e40 x14: 0x000000000000000a x15: 0x00000001ca1a3890
x16: 0x0000000104fa6e40 x17: 0xc00000019c000000 x18: 0x0000000000000000 x19: 0x00000001d6841ed8
x20: 0x0000000283665e00 x21: 0x00000001ca156324 x22: 0x0000000104fa6e40 x23: 0x0000000000000001
x24: 0x0000000000000001 x25: 0x0000000000000001 x26: 0x0000000105572c60 x27: 0x000000012a229a00
x28: 0x0000000100000002 fp: 0x000000016b256a30 lr: 0x000000019bad4870
sp: 0x000000016b2569d0 pc: 0x000000019bad487c cpsr: 0x60000000

Binary Rejected

I have submitted my app to Review and it was rejected.
To sum up, Apple said my app crashed on launch, and that I should test it on a real device.
I have tested my app in several real devices, both iPhones and iPads, as well as it has been tested through TestFlight without any known crashes on launch.
They've appended the crash_log for me to analyze the issue, but I cannot identify the problem based in the information they've provided, and maybe someone can help me find what may be causing the supposed issue based in their crash_log.
I can only identify that it crashed in the Main Thread which is pretty vague.
Here's the crash_log
{"app_name":"Union","timestamp":"2018-08-12 11:03:04.14 -0700","app_version":"1.0","slice_uuid":"4fab1f57-a08b-3604-9e09-73488d1e4019","adam_id":1346010710,"build_version":"23","bundleID":"com.ivancantarino.Union","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 11.4.1 (15G77)","incident_id":"AD9ED6DF-E560-49F8-A3C9-0454A7E7EA82","name":"Union"}
Incident Identifier: AD9ED6DF-E560-49F8-A3C9-0454A7E7EA82
CrashReporter Key: 2f0a1db768819ed531b57a3f0eceba0c4e03cc30
Hardware Model: xxx1
Process: Union [272]
Path: /private/var/containers/Bundle/Application/1235D72F-63C9-49F7-B29F-9DB2EF9B8DDC/Union.app/Union
Identifier: com.ivancantarino.Union
Version: 23 (1.0)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.ivancantarino.Union [390]
Date/Time: 2018-08-12 11:03:03.8680 -0700
Launch Time: 2018-08-12 11:00:58.0841 -0700
OS Version: iPhone OS 11.4.1 (15G77)
Baseband Version: n/a
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000100f601f4
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [0]
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 Union 0x0000000100f601f4 0x100dfc000 + 1458676
1 Union 0x0000000100f6635c 0x100dfc000 + 1483612
2 Union 0x0000000100f5caa8 0x100dfc000 + 1444520
3 Foundation 0x00000001820d21bc 0x1820a1000 + 201148
4 CoreFoundation 0x0000000181700c3c 0x181629000 + 883772
5 CoreFoundation 0x00000001817001b8 0x181629000 + 881080
6 CoreFoundation 0x00000001816fff14 0x181629000 + 880404
7 CoreFoundation 0x000000018177d84c 0x181629000 + 1394764
8 CoreFoundation 0x0000000181636f38 0x181629000 + 57144
9 Foundation 0x00000001820a7bbc 0x1820a1000 + 27580
10 UIKit 0x000000018b737518 0x18b337000 + 4195608
11 UIKit 0x000000018b348d94 0x18b337000 + 73108
12 UIKit 0x000000018bfde84c 0x18b337000 + 13269068
13 UIKit 0x000000018b3481ec 0x18b337000 + 70124
14 UIKit 0x000000018bdc3ac8 0x18b337000 + 11061960
15 UIKit 0x000000018bf11bf8 0x18b337000 + 12430328
16 UIKit 0x000000018b347c0c 0x18b337000 + 68620
17 UIKit 0x000000018b3475a8 0x18b337000 + 66984
18 UIKit 0x000000018b385334 0x18b337000 + 320308
19 FrontBoardServices 0x0000000183f70f24 0x183f64000 + 53028
20 libdispatch.dylib 0x0000000181060a60 0x18105f000 + 6752
21 libdispatch.dylib 0x0000000181068170 0x18105f000 + 37232
22 FrontBoardServices 0x0000000183fa4878 0x183f64000 + 264312
23 FrontBoardServices 0x0000000183fa451c 0x183f64000 + 263452
24 FrontBoardServices 0x0000000183fa4ab8 0x183f64000 + 264888
25 CoreFoundation 0x0000000181717404 0x181629000 + 975876
26 CoreFoundation 0x0000000181716c2c 0x181629000 + 973868
27 CoreFoundation 0x000000018171479c 0x181629000 + 964508
28 CoreFoundation 0x0000000181634da8 0x181629000 + 48552
29 GraphicsServices 0x000000018361a020 0x18360f000 + 45088
30 UIKit 0x000000018b654758 0x18b337000 + 3266392
31 Union 0x0000000100e031e4 0x100dfc000 + 29156
32 libdyld.dylib 0x00000001810c5fc0 0x1810c5000 + 4032
Thread 1 name: com.apple.uikit.eventfetch-thread
Thread 1:
0 libsystem_kernel.dylib 0x00000001811d3de8 0x1811d3000 + 3560
1 libsystem_kernel.dylib 0x00000001811d3c60 0x1811d3000 + 3168
2 CoreFoundation 0x0000000181716e40 0x181629000 + 974400
3 CoreFoundation 0x0000000181714908 0x181629000 + 964872
4 CoreFoundation 0x0000000181634da8 0x181629000 + 48552
5 Foundation 0x00000001820a9674 0x1820a1000 + 34420
6 Foundation 0x00000001820a951c 0x1820a1000 + 34076
7 UIKit 0x000000018b339768 0x18b337000 + 10088
8 Foundation 0x00000001821b9efc 0x1820a1000 + 1150716
9 libsystem_pthread.dylib 0x0000000181395220 0x181393000 + 8736
10 libsystem_pthread.dylib 0x0000000181395110 0x181393000 + 8464
11 libsystem_pthread.dylib 0x0000000181393b10 0x181393000 + 2832
Thread 2:
0 libsystem_pthread.dylib 0x0000000181393b04 0x181393000 + 2820
Thread 3:
0 libsystem_kernel.dylib 0x00000001811f5d78 0x1811d3000 + 142712
1 libsystem_pthread.dylib 0x0000000181393eb4 0x181393000 + 3764
2 libsystem_pthread.dylib 0x0000000181393b08 0x181393000 + 2824
Thread 4:
0 libsystem_pthread.dylib 0x0000000181393b04 0x181393000 + 2820
Thread 5:
0 libsystem_pthread.dylib 0x0000000181393b04 0x181393000 + 2820
Thread 6:
0 libsystem_pthread.dylib 0x0000000181393b04 0x181393000 + 2820
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x00000001c00320e0 x1: 0x0000000000000303 x2: 0x0000000000000303 x3: 0x0000000000000000
x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x0000000102009cd0 x7: 0x0000000000000000
x8: 0x00000000000003d0 x9: 0x0000000000000000 x10: 0x000001a1b39294a1 x11: 0x0000002d0000003f
x12: 0x0000000102868870 x13: 0x000021a1b39294a1 x14: 0x00000000000d52ac x15: 0x00000000000003ff
x16: 0x0000000180944250 x17: 0x00000001820b43dc x18: 0x0000000000000000 x19: 0x00000001c00320e0
x20: 0x0000000000000000 x21: 0x0000000000000000 x22: 0x00000001ac5221c0 x23: 0x00000001c0025500
x24: 0x00000001b38ce000 x25: 0x00000001b38ce000 x26: 0x0000000101e4c338 x27: 0x00000001b38c8878
x28: 0x0000000000000001 fp: 0x000000016f001880 lr: 0x0000000100f60184
sp: 0x000000016f001850 pc: 0x0000000100f601f4 cpsr: 0x20000000
Can you identify the root cause based in these information?
They've provided binary images with the crash_log but from what I'm concerned it only shows the libraries I'm using.
EDIT
After symbolicate the crash_log I got the following:
{"app_name":"Union","timestamp":"2018-08-12 11:03:04.14 -0700","app_version":"1.0","slice_uuid":"4fab1f57-a08b-3604-9e09-73488d1e4019","adam_id":1346010710,"build_version":"23","bundleID":"com.ivancantarino.Union","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 11.4.1 (15G77)","incident_id":"AD9ED6DF-E560-49F8-A3C9-0454A7E7EA82","name":"Union"}
Incident Identifier: AD9ED6DF-E560-49F8-A3C9-0454A7E7EA82
CrashReporter Key: 2f0a1db768819ed531b57a3f0eceba0c4e03cc30
Hardware Model: xxx1
Process: Union [272]
Path: /private/var/containers/Bundle/Application/1235D72F-63C9-49F7-B29F-9DB2EF9B8DDC/Union.app/Union
Identifier: com.ivancantarino.Union
Version: 23 (1.0)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.ivancantarino.Union [390]
Date/Time: 2018-08-12 11:03:03.8680 -0700
Launch Time: 2018-08-12 11:00:58.0841 -0700
OS Version: iPhone OS 11.4.1 (15G77)
Baseband Version: n/a
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000100f601f4
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [0]
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 Union 0x0000000100f601f4 0x100dfc000 + 1458676
1 Union 0x0000000100f6635c 0x100dfc000 + 1483612
2 Union 0x0000000100f5caa8 0x100dfc000 + 1444520
3 Foundation 0x00000001820d21bc -[__NSObserver _doit:] + 312
4 CoreFoundation 0x0000000181700c3c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
5 CoreFoundation 0x00000001817001b8 _CFXRegistrationPost + 428
6 CoreFoundation 0x00000001816fff14 ___CFXNotificationPost_block_invoke + 216
7 CoreFoundation 0x000000018177d84c -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1408
8 CoreFoundation 0x0000000181636f38 _CFXNotificationPost + 384
9 Foundation 0x00000001820a7bbc -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
10 UIKit 0x000000018b737518 -[UIApplication _sendWillEnterForegroundCallbacks] + 232
11 UIKit 0x000000018b348d94 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1388
12 UIKit 0x000000018bfde84c __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 296
13 UIKit 0x000000018b3481ec -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 432
14 UIKit 0x000000018bdc3ac8 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220
15 UIKit 0x000000018bf11bf8 _performActionsWithDelayForTransitionContext + 112
16 UIKit 0x000000018b347c0c -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 248
17 UIKit 0x000000018b3475a8 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 368
18 UIKit 0x000000018b385334 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 468
19 FrontBoardServices 0x0000000183f70f24 __80-[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke.362 + 212
20 libdispatch.dylib 0x0000000181060a60 _dispatch_client_callout + 16
21 libdispatch.dylib 0x0000000181068170 _dispatch_block_invoke_direct$VARIANT$mp + 224
22 FrontBoardServices 0x0000000183fa4878 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36
23 FrontBoardServices 0x0000000183fa451c -[FBSSerialQueue _performNext] + 404
24 FrontBoardServices 0x0000000183fa4ab8 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
25 CoreFoundation 0x0000000181717404 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
26 CoreFoundation 0x0000000181716c2c __CFRunLoopDoSources0 + 276
27 CoreFoundation 0x000000018171479c __CFRunLoopRun + 1204
28 CoreFoundation 0x0000000181634da8 CFRunLoopRunSpecific + 552
29 GraphicsServices 0x000000018361a020 GSEventRunModal + 100
30 UIKit 0x000000018b654758 UIApplicationMain + 236
31 Union 0x0000000100e031e4 0x100dfc000 + 29156
32 libdyld.dylib 0x00000001810c5fc0 start + 4
Thread 1 name: com.apple.uikit.eventfetch-thread
Thread 1:
0 libsystem_kernel.dylib 0x00000001811d3de8 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001811d3c60 mach_msg + 72
2 CoreFoundation 0x0000000181716e40 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x0000000181714908 __CFRunLoopRun + 1568
4 CoreFoundation 0x0000000181634da8 CFRunLoopRunSpecific + 552
5 Foundation 0x00000001820a9674 -[NSRunLoop+ 34420 (NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x00000001820a951c -[NSRunLoop+ 34076 (NSRunLoop) runUntilDate:] + 148
7 UIKit 0x000000018b339768 -[UIEventFetcher threadMain] + 136
8 Foundation 0x00000001821b9efc __NSThread__start__ + 1040
9 libsystem_pthread.dylib 0x0000000181395220 _pthread_body + 272
10 libsystem_pthread.dylib 0x0000000181395110 _pthread_body + 0
11 libsystem_pthread.dylib 0x0000000181393b10 thread_start + 4
Thread 2:
0 libsystem_pthread.dylib 0x0000000181393b04 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x00000001811f5d78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000181393eb4 _pthread_wqthread + 928
2 libsystem_pthread.dylib 0x0000000181393b08 start_wqthread + 4
Thread 4:
0 libsystem_pthread.dylib 0x0000000181393b04 start_wqthread + 0
Thread 5:
0 libsystem_pthread.dylib 0x0000000181393b04 start_wqthread + 0
Thread 6:
0 libsystem_pthread.dylib 0x0000000181393b04 start_wqthread + 0
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x00000001c00320e0 x1: 0x0000000000000303 x2: 0x0000000000000303 x3: 0x0000000000000000
x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x0000000102009cd0 x7: 0x0000000000000000
x8: 0x00000000000003d0 x9: 0x0000000000000000 x10: 0x000001a1b39294a1 x11: 0x0000002d0000003f
x12: 0x0000000102868870 x13: 0x000021a1b39294a1 x14: 0x00000000000d52ac x15: 0x00000000000003ff
x16: 0x0000000180944250 x17: 0x00000001820b43dc x18: 0x0000000000000000 x19: 0x00000001c00320e0
x20: 0x0000000000000000 x21: 0x0000000000000000 x22: 0x00000001ac5221c0 x23: 0x00000001c0025500
x24: 0x00000001b38ce000 x25: 0x00000001b38ce000 x26: 0x0000000101e4c338 x27: 0x00000001b38c8878
x28: 0x0000000000000001 fp: 0x000000016f001880 lr: 0x0000000100f60184
sp: 0x000000016f001850 pc: 0x0000000100f601f4 cpsr: 0x20000000
Somehow my Union stacktrace doesn't point to any line of code as the ones below.

iOS In App Purchase crashed only in App review - works find in sandbox testing

I have a new app which has been rejected twice with the same crash logs. They say it crashes when they tap the Buy button for in app purchase and gave me the crash file. I have symbolicated it and it hasn't been much helpful to me, can someone else take a look and point out if something's wrong?
The IAP has been tested successfully in sandbox with 2 sandbox users. I have also made sure my IAP has been actually "Cleared for sale" from my side and also "Submitted for review". My bank account info is up to date too and contracts are approved.
Here's the symbolicated logs:
{"app_name":"APPNAME","timestamp":"2017-12-18 08:48:19.56 -0800","app_version":"1.0","slice_uuid":"915a18a0-7c26-3ffd-af45-102cc6d53e21","adam_id":1326580740,"build_version":"2","bundleID":"com.MYCOMPANY.APPNAME","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 11.2.1 (15C153)","incident_id":"43C16882-BFF8-4C5E-80D7-01AEEE78F017","name":"APPNAME"}
Incident Identifier: 43C16882-BFF8-4C5E-80D7-01AEEE78F017
CrashReporter Key: 6079b68e9b231d52a24bc0ce1c55aa975b16774c
Hardware Model: xxx
Process: APPNAME [1217]
Path: /private/var/containers/Bundle/Application/81E108AB-4E43-4034-9A37-6C83929E75D4/APPNAME.app/APPNAME
Identifier: com.MYCOMPANY.APPNAME
Version: 2 (1.0)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.MYCOMPANY.APPNAME [832]
Date/Time: 2017-12-18 08:48:19.4110 -0800
Launch Time: 2017-12-18 08:43:02.9432 -0800
OS Version: iPhone OS 11.2.1 (15C153)
Baseband Version: 6.30.04
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 0x18411e364 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x183364528 objc_exception_throw + 55
2 CoreFoundation 0x18411e2ac +[NSException raise:format:] + 115
3 StoreKit 0x19758aa98 -[SKPaymentQueue addPayment:] + 539
4 APPNAME 0x1007a362c 0x100798000 + 46636
5 UIKit 0x18d6346b4 -[UIApplication sendAction:to:from:forEvent:] + 95
6 UIKit 0x18d634634 -[UIControl sendAction:to:forEvent:] + 79
7 UIKit 0x18d61f1dc -[UIControl _sendActionsForEvents:withEvent:] + 439
8 UIKit 0x18d633f28 -[UIControl touchesEnded:withEvent:] + 575
9 UIKit 0x18d633a48 -[UIWindow _sendTouchesForEvent:] + 2543
10 UIKit 0x18d62ef60 -[UIWindow sendEvent:] + 3207
11 UIKit 0x18d5fff64 -[UIApplication sendEvent:] + 339
12 UIKit 0x18df5531c __dispatchPreprocessedEventFromEventQueue + 2363
13 UIKit 0x18df578a8 __handleEventQueueInternal + 4759
14 UIKit 0x18df507c0 __handleHIDEventFetcherDrain + 151
15 CoreFoundation 0x1840c697c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 23
16 CoreFoundation 0x1840c68fc __CFRunLoopDoSource0 + 87
17 CoreFoundation 0x1840c6184 __CFRunLoopDoSources0 + 203
18 CoreFoundation 0x1840c3d5c __CFRunLoopRun + 1047
19 CoreFoundation 0x183fe3e58 CFRunLoopRunSpecific + 435
20 GraphicsServices 0x185e90f84 GSEventRunModal + 99
21 UIKit 0x18d66367c UIApplicationMain + 235
22 APPNAME 0x1007aab60 0x100798000 + 76640
23 libdyld.dylib 0x183b0056c start + 3
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000183c302e8 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000183d452f8 pthread_kill$VARIANT$mp + 396
2 libsystem_c.dylib 0x0000000183b9efbc abort + 140
3 libc++abi.dylib 0x000000018333b068 __cxa_bad_cast + 0
4 libc++abi.dylib 0x000000018333b210 default_unexpected_handler+ 8720 () + 0
5 libobjc.A.dylib 0x0000000183364810 _objc_terminate+ 34832 () + 124
6 libc++abi.dylib 0x000000018335354c std::__terminate(void (*)+ 107852 ()) + 16
7 libc++abi.dylib 0x0000000183353158 __cxa_rethrow + 144
8 libobjc.A.dylib 0x00000001833646e8 objc_exception_rethrow + 44
9 CoreFoundation 0x0000000183fe3ec4 CFRunLoopRunSpecific + 544
10 GraphicsServices 0x0000000185e90f84 GSEventRunModal + 100
11 UIKit 0x000000018d66367c UIApplicationMain + 236
12 APPNAME 0x00000001007aab60 0x100798000 + 76640
13 libdyld.dylib 0x0000000183b0056c start + 4
Thread 1 name: com.apple.uikit.eventfetch-thread
Thread 1:
0 libsystem_kernel.dylib 0x0000000183c0f568 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000183c0f3e0 mach_msg + 72
2 CoreFoundation 0x00000001840c6308 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x00000001840c3ed4 __CFRunLoopRun + 1424
4 CoreFoundation 0x0000000183fe3e58 CFRunLoopRunSpecific + 436
5 Foundation 0x0000000184a19594 -[NSRunLoop+ 50580 (NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x0000000184a389ac -[NSRunLoop+ 178604 (NSRunLoop) runUntilDate:] + 96
7 UIKit 0x000000018e1cd7b8 -[UIEventFetcher threadMain] + 136
8 Foundation 0x0000000184b1b0f4 __NSThread__start__ + 996
9 libsystem_pthread.dylib 0x0000000183d442b4 _pthread_body + 308
10 libsystem_pthread.dylib 0x0000000183d44180 _pthread_body + 0
11 libsystem_pthread.dylib 0x0000000183d42b74 thread_start + 4
Thread 2 name: com.apple.NSURLConnectionLoader
Thread 2:
0 libsystem_kernel.dylib 0x0000000183c0f568 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000183c0f3e0 mach_msg + 72
2 CoreFoundation 0x00000001840c6308 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x00000001840c3ed4 __CFRunLoopRun + 1424
4 CoreFoundation 0x0000000183fe3e58 CFRunLoopRunSpecific + 436
5 CFNetwork 0x00000001848d3128 -[__CoreSchedulingSetRunnable runForever] + 780
6 Foundation 0x0000000184b1b0f4 __NSThread__start__ + 996
7 libsystem_pthread.dylib 0x0000000183d442b4 _pthread_body + 308
8 libsystem_pthread.dylib 0x0000000183d44180 _pthread_body + 0
9 libsystem_pthread.dylib 0x0000000183d42b74 thread_start + 4
Thread 3:
0 libsystem_pthread.dylib 0x0000000183d42b68 start_wqthread + 0
Thread 4:
0 libsystem_pthread.dylib 0x0000000183d42b68 start_wqthread + 0
Thread 5:
0 libsystem_pthread.dylib 0x0000000183d42b68 start_wqthread + 0
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x00000001c40f9937
x4: 0x0000000183358afd x5: 0x000000016f6674d0 x6: 0x000000000000006e x7: 0xffffffffffffffec
x8: 0x0000000008000000 x9: 0x0000000004000000 x10: 0x0000000183d495e0 x11: 0x0000000000000003
x12: 0xffffffffffffffff x13: 0x0000000000000001 x14: 0x0000000183bb553f x15: 0x0000000000000010
x16: 0x0000000000000148 x17: 0x00000000ffffffff x18: 0xfffffff00e09925c x19: 0x0000000000000006
x20: 0x00000001b4e6fb80 x21: 0x000000016f6674d0 x22: 0x0000000000000303 x23: 0x00000001b4e6fc60
x24: 0x00000001c0005270 x25: 0x0000000000000000 x26: 0x0000000000000001 x27: 0x0000000000000000
x28: 0x000000016f667b30 fp: 0x000000016f667430 lr: 0x0000000183d452f8
sp: 0x000000016f667400 pc: 0x0000000183c302e8 cpsr: 0x00000000
I resolved this.
In Xcode > Target > Capabilities > Make sure to switch on In app purchases here. If you don't, then while testing with Sandbox, the in app purchase will work just fine. However when app review will test OR when app is live, tapping the Buy button will cause the app to crash because for some reason, the product won't load. The crash log won't be much useful as it will just show StoreKit crash but won't mention anything about capability. Enabling the IAP in capabilities is needed for the IAP to work in live apps. I have no idea why this inconsistency exists between Sandbox testing and App review/Live app.
Also in the code, only do addPayment if the Product is not nil. Since my capability wasn't set on, the product wasn't loading. So when I was calling addPayment, it crashed with:
[SKPaymentQueue addPayment:]
Also in iTunes connect, in banking info, make sure the "Account holder type" field is set. Not sure if this is a new field but mind wasn't set and I have been successfully submitting IAP for 5 years. Only this time, it said the holder type wasn't set.
Now the app review team hasn't reported IAP crash.

Resources