Watch application crashes even before launching in device, Please help me understand this device log.

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 0x5458c64e __exceptionPreprocess + 222

1 libobjc.A.dylib 0x53ff07c0 objc_exception_throw + 33

2 CoreFoundation 0x544bd2c4 +[NSException raise:format:] + 91

3 HealthKit 0x5ff78844 -[HKHealthStore _validateHealthDataPurposeStringsForSharingTypes:readingTypes:] + 353

4 HealthKit 0x5ff78466 -[HKHealthStore _validatePurposeStringsForSharingTypes:readingTypes:] + 307

5 HealthKit 0x5ff77db2 -[HKHealthStore requestAuthorizationToShareTypes:readTypes:shouldPrompt:completion:] + 299

6 HealthKit 0x5ff77b76 -[HKHealthStore requestAuthorizationToShareTypes:readTypes:completion:] + 55

7 Responsometer WatchKit Extension 0x0034f54c 0x2dc000 + 472396

8 Responsometer WatchKit Extension 0x003b9956 0x2dc000 + 907606

9 Responsometer WatchKit Extension 0x0034c3bc 0x2dc000 + 459708

10 Responsometer WatchKit Extension 0x0034c8a0 0x2dc000 + 460960

11 WatchKit 0x637d9560 __62-[SPRemoteInterface didAppearViewController:clientIdentifier:]_block_invoke_4 + 127

12 WatchKit 0x637d7900 -[SPRemoteInterface _activateViewController:clientIdentifier:] + 545

13 WatchKit 0x637d6d16 -[WKInterfaceController _finishGestureInstallationWithCompletion:] + 311

14 WatchKit 0x637d76aa __61-[SPRemoteInterface activateViewController:clientIdentifier:]_block_invoke_2 + 119

15 WatchKit 0x637d276e -[SPRemoteInterface performAfterApplicationDidFinishLaunching:] + 35

16 WatchKit 0x637d761e __61-[SPRemoteInterface activateViewController:clientIdentifier:]_block_invoke + 91

17 WatchKit 0x637d11d8 spUtils_dispatchAsyncToMainThread + 17

18 WatchKit 0x637d7516 -[SPRemoteInterface activateViewController:clientIdentifier:] + 153

19 WatchKit 0x637d7460 __57-[SPExtensionConnection interfaceViewControllerActivate:]_block_invoke + 369

20 WatchKit 0x637cfc2c -[SPExtensionConnection performOnSendQueue:syncIfUnsuspended:] + 497

21 WatchKit 0x637d7288 -[SPExtensionConnection interfaceViewControllerActivate:] + 185

22 WatchKit 0x637d71b0 -[SPApplicationDelegate viewControllerWillActivate:] + 137

23 WatchKit 0x637d7084 -[SPViewController controllerWillActivate] + 209

24 WatchKit 0x637cbf16 -[SPInterfaceViewController controllerWillActivate] + 309

25 WatchKit 0x6382edf0 -[SPViewController applicationDidFinishLaunchingInDock] + 21

26 WatchKit 0x63858382 __67-[SPApplicationDelegate application:didFinishLaunchingWithOptions:]_block_invoke + 149

27 libdispatch.dylib 0x5409d842 _dispatch_call_block_and_release + 5

28 libdispatch.dylib 0x5409e8b4 _dispatch_client_callout + 1

29 libdispatch.dylib 0x540a86ac _dispatch_main_queue_callback_4CF + 863

30 CoreFoundation 0x545279b6 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 5

31 CoreFoundation 0x54523a0c __CFRunLoopRun + 1827

32 CoreFoundation 0x54523046 CFRunLoopRunSpecific + 365

33 GraphicsServices 0x57310ccc GSEventRunModal + 91

34 UIKitCore 0x6c354d80 UIApplicationMain + 1725

35 libxpc.dylib 0x542bfcec _xpc_objc_main.cold.3 + 147

36 libxpc.dylib 0x542b0a30 _xpc_objc_main + 179

37 libxpc.dylib 0x542b2930 xpc_main + 105

38 Foundation 0x54da3172 -[NSXPCListener resume] + 167

39 PlugInKit 0x5bf1d278 0x5bf0b000 + 74360

40 WatchKit 0x637ccafa WKExtensionMain + 57

41 WatchKit 0x6388201c main + 5

42 libdyld.dylib 0x540d9e7e 0x540d6000 + 15998





Thread 0 name: Dispatch queue: com.apple.main-thread

Thread 0 Crashed:

0 libsystem_kernel.dylib 0x541fafc8 __pthread_kill + 8

1 libsystem_pthread.dylib 0x542723c2 pthread_kill + 88

2 libsystem_c.dylib 0x541843a4 abort + 84

3 libc++abi.dylib 0x53fdc556 __cxa_bad_cast + 0

4 libc++abi.dylib 0x53fdc72a demangling_unexpected_handler+ 10026 () + 0

5 libobjc.A.dylib 0x53ff09fe _objc_terminate+ 27134 () + 102

6 libc++abi.dylib 0x53fe5364 std::__terminate(void (*)+ 45924 ()) + 6

7 libc++abi.dylib 0x53fe5310 std::terminate+ 45840 () + 58

8 libdispatch.dylib 0x5409e8c2 _dispatch_client_callout + 16

9 libdispatch.dylib 0x540a86b0 _dispatch_main_queue_callback_4CF + 868

10 CoreFoundation 0x545279ba __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 10

11 CoreFoundation 0x54523a10 __CFRunLoopRun + 1832

12 CoreFoundation 0x5452304a CFRunLoopRunSpecific + 370

13 GraphicsServices 0x57310cd0 GSEventRunModal + 96

14 UIKitCore 0x6c354d84 UIApplicationMain + 1730

15 libxpc.dylib 0x542bfcf0 _xpc_objc_main.cold.3 + 152

16 libxpc.dylib 0x542b0a34 _xpc_objc_main + 184

17 libxpc.dylib 0x542b2934 xpc_main + 110

18 Foundation 0x54da3176 +[NSXPCListener serviceListener] + 0

19 PlugInKit 0x5bf1d27c 0x5bf0b000 + 74364

20 WatchKit 0x637ccafe WKExtensionMain + 62

21 WatchKit 0x63882020 main + 10

22 libdyld.dylib 0x540d9e82 start + 2



Thread 1:

0 libsystem_pthread.dylib 0x542780d0 start_wqthread + 0



Thread 2:

0 libsystem_pthread.dylib 0x542780d0 start_wqthread + 0



Thread 3:

0 libsystem_pthread.dylib 0x542780d0 start_wqthread + 0



Thread 4 name: com.apple.uikit.eventfetch-thread

Thread 4:

0 libsystem_kernel.dylib 0x541e3814 mach_msg_trap + 20

1 libsystem_kernel.dylib 0x541e2ece mach_msg + 42

2 CoreFoundation 0x54527756 __CFRunLoopServiceMachPort + 152

3 CoreFoundation 0x545237ee __CFRunLoopRun + 1286

4 CoreFoundation 0x5452304a CFRunLoopRunSpecific + 370

5 Foundation 0x54d6f3a8 -[NSRunLoop+ 29608 (NSRunLoop) runMode:beforeDate:] + 180

6 Foundation 0x54d6f2c4 -[NSRunLoop+ 29380 (NSRunLoop) runUntilDate:] + 76

7 UIKitCore 0x6c3d2a72 -[UIEventFetcher threadMain] + 140

8 Foundation 0x54e71b70 __NSThread__start__ + 708

9 libsystem_pthread.dylib 0x54271528 _pthread_start + 110

10 libsystem_pthread.dylib 0x542780fc thread_start + 20



Thread 5 name: com.apple.CoreMotion.MotionThread

Thread 5:

0 libsystem_kernel.dylib 0x541e3814 mach_msg_trap + 20

1 libsystem_kernel.dylib 0x541e2ece mach_msg + 42

2 CoreFoundation 0x54527756 __CFRunLoopServiceMachPort + 152

3 CoreFoundation 0x545237ee __CFRunLoopRun + 1286

4 CoreFoundation 0x5452304a CFRunLoopRunSpecific + 370

5 CoreFoundation 0x54523b96 CFRunLoopRun + 54

6 CoreMotion 0x5c7ad9be 0x5c6e8000 + 809406

7 libsystem_pthread.dylib 0x54271528 _pthread_start + 110

8 libsystem_pthread.dylib 0x542780fc thread_start + 20



Thread 6:

0 libsystem_pthread.dylib 0x542780d0 start_wqthread + 0



Thread 0 crashed with ARM Thread State (32-bit):

r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x00000000

r4: 0x00000006 r5: 0x00000407 r6: 0x78da43e0 r7: 0x27b26708

r8: 0x009a58f0 r9: 0x00000001 r10: 0x00000000 r11: 0x00000114

ip: 0x00000148 sp: 0x27b266f0 lr: 0x542723c3 pc: 0x541fafc8

cpsr: 0x40000010





Error Formulating Crash Report:

thread_get_state(...ARM_EXCEPTION_STATE64) returned 4: (os/kern) invalid argument



EOF

Accepted Reply

The presence of the Last Exception Backtrace section indicates that your app has crashed due to an unhandled language exception. Looking at that backtrace, it seems like that this is the result of you not having an appropriate purpose string in your app. Specifically, look at the API you’re calling in frame 6 (

-[HKHealthStore requestAuthorizationToShareTypes:readTypes:completion:]
) and the method name in frame 3 (-[HKHealthStore _validateHealthDataPurposeStringsForSharingTypes:readingTypes:]`).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

The presence of the Last Exception Backtrace section indicates that your app has crashed due to an unhandled language exception. Looking at that backtrace, it seems like that this is the result of you not having an appropriate purpose string in your app. Specifically, look at the API you’re calling in frame 6 (

-[HKHealthStore requestAuthorizationToShareTypes:readTypes:completion:]
) and the method name in frame 3 (-[HKHealthStore _validateHealthDataPurposeStringsForSharingTypes:readingTypes:]`).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thank you