builttoroam / device_calendar

A cross platform plugin for modifying calendars on the user's device
https://pub.dev/packages/device_calendar
BSD 3-Clause "New" or "Revised" License
259 stars 258 forks source link

[iOS] App getting crashed on trying to add an event #456

Open pvsvamsi opened 1 year ago

pvsvamsi commented 1 year ago

Describe the bug Observing a crash on trying to create an event in the calendar

Last Exception Backtrace: 0 CoreFoundation 0x1a5f99e88 __exceptionPreprocess + 164 (NSException.m:202) 1 libobjc.A.dylib 0x19f2cf8d8 objc_exception_throw + 60 (objc-exception.mm:356) 2 CoreFoundation 0x1a613f0a8 _CFThrowFormattedException + 108 (CFObject.m:2235) 3 CoreFoundation 0x1a614a5e0 -[NSDictionaryM setObject:forKeyedSubscript:].cold.1 + 52 (NSDictionaryM.m:199) 4 CoreFoundation 0x1a5fa3930 -[NSDictionaryM setObject:forKeyedSubscript:] + 928 (NSDictionaryM.m:199) 5 EventKit 0x1c19d3f78 -[EKEvent _addNewAttendeesToRecentsIfNeeded] + 308 (EKEvent.m:5451) 6 EventKit 0x1c1962448 -[EKEvent markAsSaved] + 36 (EKEvent.m:5367) 7 EventKit 0x1c1a1e404 -[EKEventStore save:] + 292 (EKEventStore.m:6087) 8 EventKit 0x1c1a12c88 -[EKEventStore _saveEvent:span:commit:error:] + 372 (EKEventStore.m:3298) 9 EventKit 0x1c1a12a90 -[EKEventStore saveEvent:span:commit:error:] + 200 (EKEventStore.m:3259) 10 devicecalendar 0x102cddfac specialized closure #1 in SwiftDeviceCalendarPlugin.createOrUpdateEvent(:_:) + 4600 (SwiftDeviceCalendarPlugin.swift:708) 11 device_calendar 0x102ce1a08 $s15device_calendar25SwiftDeviceCalendarPluginC19createOrUpdateEvent33_4C43A9B8F549DDA4497FB093A5AFFC71LLyySo17FlutterMethodCallC_yypSgctFyyXEfU_015$syXlSgIeyBy_ypX7Iegn_TRyXlSgIeyBy_Tf1nnc_n + 16 (:0) 12 devicecalendar 0x102ce1a08 specialized SwiftDeviceCalendarPlugin.handle(:result:) + 2468 (:882) 13 device_calendar 0x102ccd750 $s15device_calendar25SwiftDeviceCalendarPluginC6handle_6resultySo17FlutterMethodCallC_yypSgctF015$syXlSgIeyBy_ypN7Iegn_TRyXlSgIeyBy_Tf1ncn_n + 16 (:0) 14 devicecalendar 0x102ccd750 @objc SwiftDeviceCalendarPlugin.handle(:result:) + 84 15 Flutter 0x103653cd0 0x1030dc000 + 5733584 16 Flutter 0x10311fde4 0x1030dc000 + 277988 17 libdispatch.dylib 0x1ad5684b4 _dispatch_call_block_and_release + 32 (init.c:1518) 18 libdispatch.dylib 0x1ad569fdc _dispatch_client_callout + 20 (object.m:560) 19 libdispatch.dylib 0x1ad5787f4 _dispatch_main_queue_drain + 928 (inline_internal.h:2632) 20 libdispatch.dylib 0x1ad578444 _dispatch_main_queue_callback_4CF + 44 (queue.c:7887) 21 CoreFoundation 0x1a602a6f8 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16 (CFRunLoop.c:1780) 22 CoreFoundation 0x1a600c058 __CFRunLoopRun + 2036 (CFRunLoop.c:3147) 23 CoreFoundation 0x1a6010ed4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418) 24 GraphicsServices 0x1df312368 GSEventRunModal + 164 (GSEvent.c:2196) 25 UIKitCore 0x1a84ef3d0 -[UIApplication _run] + 888 (UIApplication.m:3745) 26 UIKitCore 0x1a84ef034 UIApplicationMain + 340 (UIApplication.m:5335) 27 Runner 0x10066293c main + 64 (AppDelegate.swift:5) 28 dyld 0x1c4678960 start + 2528 (dyldMain.cpp:1170)

Device(s) tested This can be very important as not all device vendors do calendar in the same way.

IVLIVS-III commented 1 year ago

Can you provide more information on what you did, which fields of the Event you populated, whether the crash is reproducible, and in that case a reproduction example? Anything you can provide could help us identify and fix the issue.

olegpryshlyak commented 1 year ago

In my case the following steps will reproduce the crash: 1) Create a new event. 2) Using the Calendar application add the attendees to that event. 3) Retrieve that event in the app and try to update any field there. 4) App will crash when the event kit tries to save the event. Reproducible on iOS 16+.

pvsvamsi commented 1 year ago

@IVLIVS-III

Fresh crash log

Fatal Exception: NSInvalidArgumentException 0 CoreFoundation 0x9e48 exceptionPreprocess 1 libobjc.A.dylib 0x178d8 objc_exception_throw 2 CoreFoundation 0x1af088 -[NSCFString characterAtIndex:].cold.1 3 CoreFoundation 0x1ba5c0 -[NSDictionaryM setObject:forKeyedSubscript:].cold.2 4 CoreFoundation 0x138f0 -[NSDictionaryM setObject:forKeyedSubscript:] 5 EventKit 0x94de4 -[EKEvent _addNewAttendeesToRecentsIfNeeded] 6 EventKit 0x2327c -[EKEvent markAsSaved] 7 EventKit 0xdf29c -[EKEventStore save:] 8 EventKit 0xd3b20 -[EKEventStore _saveEvent:span:commit:error:] 9 EventKit 0xd3928 -[EKEventStore saveEvent:span:commit:error:] 10 device_calendar 0x19fac (Missing UUID 4429b0700b4e3d548b8f8105d282a09e) 11 device_calendar 0x1da08 (Missing UUID 4429b0700b4e3d548b8f8105d282a09e) 12 device_calendar 0x9750 (Missing UUID 4429b0700b4e3d548b8f8105d282a09e) 13 Flutter 0x577cd0 (Missing UUID 4aeaca1fde2f3daeb5830cf99fcf86e3) 14 Flutter 0x43de4 (Missing UUID 4aeaca1fde2f3daeb5830cf99fcf86e3) 15 libdispatch.dylib 0x24b4 _dispatch_call_block_and_release 16 libdispatch.dylib 0x3fdc _dispatch_client_callout 17 libdispatch.dylib 0x127f4 _dispatch_main_queue_drain 18 libdispatch.dylib 0x12444 _dispatch_main_queue_callback_4CF 19 CoreFoundation 0x9a6d8 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE 20 CoreFoundation 0x7c03c __CFRunLoopRun 21 CoreFoundation 0x80ec0 CFRunLoopRunSpecific 22 GraphicsServices 0x1368 GSEventRunModal 23 UIKitCore 0x3a186c -[UIApplication _run] 24 UIKitCore 0x3a14d0 UIApplicationMain 25 Runner 0x693c main + 5 (AppDelegate.swift:5) 26 ??? 0x1c42da960 (Missing)

Steps to Reproduce :

  1. Create an event with attendees and try to edit them
thomassth commented 1 year ago

So far everyone reported this bug is on iOS 16

Did something changed there?

smediomike commented 1 year ago

I also can reproduce this issue, same callstack. anyone has solution?