Duplicate Keys of Type 'EKEvent' were found in a Dictionary

I have been playing around with EventKit recently and I added a fetch request for all Events in my calendar. But after like 20 seconds after launch, I get this error:

Fatal error: Duplicate keys of type 'EKEvent' were found in a Dictionary.

This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion.

2021-06-22 08:56:13.202792+0200 Assisty[1779:332215] Fatal error: Duplicate keys of type 'EKEvent' were found in a Dictionary.

This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion.

2021-06-22 08:57:03.745222+0200 Assisty[1779:332215] [error] precondition failure: setting value during update: 1560

I am a beginner to Xcode debugging and SwiftUI, but I can see that it thinks I have mutated something when I haven't. My app only fetches events from the user calendar and stores it in a variable of type [EKEvent]. I have no idea why this error is happening and my app is crashing left and right for no clear reason.

If any one has seen this error and knows how to fix this I would really appreciate the help.

Thanks a lot

It's difficult to know what the problem is without seeing the code you are using to fetch events and store them in an array. The best way to resolve this would be to either file a feedback assistant report with a reproducible Xcode project attached and post the FB number here, or just attach a reproducible Xcode project or snippet of code to your question here.

I have just the same problem.

Ok sorry for the late reply, Ill send you the code soon because I’m not near my computer right now.

Duplicate Keys of Type 'EKEvent' were found in a Dictionary
 
 
Q