WidgetKit Crash

On the crash reports, I am getting a lot of crashes with this crash report for two iOS 14 Widgets:

Code Block
Foundation _NSFileHandleRaiseOperationException
....
SwiftUI FileArchiveWriter.AppendByes(_size:)
....
My Widget closure #1 in MyTimelineProver.getTimeline(in:completion:)



When checked within the project, this happens in:
Code Block
func getTimeline(in context: Self.Context, completion: @escaping (Timeline<Self.Entry>) -> Void)


I have one timeline that asked to update every 5 mins.

Post marked as unsolved Up vote post of sle39lvr Down vote post of sle39lvr
292 views

5 Replies

Getting the same crash. Happens randomly on a TestFlight build.

Getting the same crash. Happens randomly on a TestFlight build.

Can you post an Apple crash report for this? Use the text attachment feature (the paperclip button) to avoid clogging up the timeline.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
I also get a lot of this issues.
It seems like my timeline get called multiple times and it just crashes
Happened to me today as well. It seems to be an error that Xcode missed before compiling, resulting in a bad function in the executable (I may or may not have used the correct terminology, I'm fairly new to app development, sorry) - I've rewritten one of my functions and suddenly it started to work again.

Until it fixed, try to delete / comment out chunks of your code (one at a time, of course) until you find where the problem is, then try to fix or rewrite it. Managed to fix that twice this way.
Make sure that you're only calling the completion handler once!
It can be a bit hard to trace with nested closures + networking, so try some print statements and see if that helps.