I know this crash is related to updating complication in background and system automatically release the object may be due to suspend state. So here is detail what I am trying to do in watchOS app.
I am updating complication content in background. This updated detail is received from server. so should I have to enable any background mode?
Provided background modes audio, Location, Remote notification and workout
But above mentioned mode did not match with my requirement as not using any above service and just updating complication data from server.
I am using scheduleBackgroundRefresh to update complication in every 15 min.
Here is crash log
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x2054c564 __abort_with_payload + 8
1 libsystem_kernel.dylib 0x20550d24 abort_with_payload_wrapper_internal + 100 (terminate_with_reason.c:102)
2 libsystem_kernel.dylib 0x20550cc0 abort_with_reason + 28 (terminate_with_reason.c:116)
3 WatchKit 0x332b916c -[WKRefreshBackgroundTask dealloc] + 536 (SPUtils.h:15)
4 watchkitapp Extension 0x02f75710 outlined consume of Set<A>.Iterator._Variant<A> + 36
5 libswiftCore.dylib 0x472552b8 _swift_release_dealloc + 28 (HeapObject.cpp:626)
6 watchkitapp Extension 0x02f757a0 partial apply for closure #1 in ExtensionDelegate.updateContentInBackgorund(_:) + 448416 (ExtensionDelegate.swift:74)
7 libswiftCore.dylib 0x472552b8 _swift_release_dealloc + 28 (HeapObject.cpp:626)
8 watchkitapp Extension 0x02f757a0 partial apply for closure #1 in ExtensionDelegate.updateContentInBackgorund(_:) + 448416 (ExtensionDelegate.swift:74)
9 watchkitapp Extension 0x02f75808 partial apply for thunk for @escaping @callee_guaranteed (@unowned Bool, @unowned Int?, @guaranteed DomainHome?, @guaranteed [String : Any]?, @guaranteed Error?) -> () + 448520 (<compiler-generated>:0)
10 libswiftCore.dylib 0x472552b8 _swift_release_dealloc + 28 (HeapObject.cpp:626)
11 watchkitapp Extension 0x02f757a0 partial apply for closure #1 in ExtensionDelegate.updateContentInBackgorund(_:) + 448416 (ExtensionDelegate.swift:74)
12 watchkitapp Extension 0x02f7581c partial apply for thunk for @escaping @callee_guaranteed (@unowned Bool, @unowned Int?, @guaranteed DomainHome?, @guaranteed [String : Any]?, @guaranteed Error?) -> () + 448540 (<compiler-generated>:0)
13 libswiftCore.dylib 0x472552b8 _swift_release_dealloc + 28 (HeapObject.cpp:626)
14 watchkitapp Extension 0x02f60c24 partial apply for specialized closure #1 in RequestManager.performRequestWithURL<A>(_:method:payload:useAuthentication:credentials:handler:) + 363556 (<compiler-generated>:0)
15 watchkitapp Extension 0x02f61b24 block_destroy_helper.85 + 16
16 libswiftCore.dylib 0x472552b8 _swift_release_dealloc + 28 (HeapObject.cpp:626)
17 libsystem_blocks.dylib 0x2042ea5c _Block_release + 140 (runtime.cpp:177)
18 libdispatch.dylib 0x20394fc0 _dispatch_client_callout + 16 (object.m:495)
19 libdispatch.dylib 0x203a0e7c _dispatch_main_queue_callback_4CF + 924 (inline_internal.h:2484)
20 CoreFoundation 0x2093ddcc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1749)
21 CoreFoundation 0x20938df4 __CFRunLoopRun + 1852 (CFRunLoop.c:3069)
22 CoreFoundation 0x209383b0 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3192)
23 GraphicsServices 0x23ed8358 GSEventRunModal + 160 (GSEvent.c:2246)
24 UIKitCore 0x3da4b87c UIApplicationMain + 1756 (UIApplication.m:4820)
25 libxpc.dylib 0x20629bdc _xpc_objc_main.cold.3 + 208
26 libxpc.dylib 0x20615c58 _xpc_objc_main + 212 (main.m:0)
27 libxpc.dylib 0x2061823c xpc_main + 152 (init.c:1384)
28 Foundation 0x213a1738 -[NSXPCListener resume] + 160 (NSXPCListener.m:276)
29 PlugInKit 0x2a30c0a8 -[PKService run] + 396 (PKService.m:165)
30 WatchKit 0x3329fe94 WKExtensionMain + 60 (main.m:19)
31 WatchKit 0x3336d93c main + 12 (main.m:27)
32 libdyld.dylib 0x203d0f48 start + 4