WKRefreshBackgroundTask

Hi Guys,


I'm having trouble with my published WatchOS app and background refreshes for the complication. Around 10% of users are reporting issues and I have a large number of crash logs for some sort of issue/crash resulting in a EXC_CRASH (SIGABRT), a termination reason is given: Namespace <0x16>, Code 0x1.

Xcode jsut highlights [WKRefreshBackgroundTask dealloc] as the cause but this doesn't really help.

I've opened up the crash logs and can see the entry but am no further to understanding what is causing these issues.

WatchKit 0x2f31b714 -[WKRefreshBackgroundTask dealloc] + 552 (SPUtils.h:15)

Any suggestions as for cause or how to debug?


Thanks!

Bump?

I have finally solved this incase anyone else experiences it! Basically, I had an odd pathline of code in the background refresh where occasionally the finishedBackgroundUpdate handler wasnt called. Because of this WatchKit was killing the app. All solved now though.

I have same problem, can you please the solution code?

Hi, I also want to know how to resolve this issue.

Hi, could you clarify this a bit more, please? What is the finishedBackgroundUpdate handler in your case?

Was this the call to set the WKRefreshBackgroundTask completed (task.setTaskCompletedWithSnapshot(false))?

What was the type of WKRefreshBackgroundTask you were dealing with?


I would really love to understand more about the problem you were facing. Could be very helpful 🙂 Thanks in advance!

It seems that more people are facing a similar problem recently. Has something been changed in the new WatchOS?

Don't have sample code, but basically you just need to ensure you call the background task completion handler. My app runs a healkit sample when the refresh task is called. When the sample returns, I call the handler and that is.

WKRefreshBackgroundTask
 
 
Q