Fatal Exception: NSGenericException *** Collection <__NSArrayM: 0x28313ce10> was mutated while being enumerated. -[CAMPriorityNotificationCenter _removeObserver:fromObserversByName:]

Fatal Exception: NSGenericException *** Collection <__NSArrayM: 0x28313ce10> was mutated while being enumerated. -[CAMPriorityNotificationCenter _removeObserver:fromObserversByName:] keyboard_arrow_down

Fatal Exception: NSGenericException

  • 0 CoreFoundation 0x1878e8298 __exceptionPreprocess

  • 1 libobjc.A.dylib 0x19b642480 objc_exception_throw

  • 2 CoreFoundation 0x1878e7c5c -[__NSSingleObjectEnumerator initWithObject:collection:]

  • 3 CameraUI 0x1affb7e7c -[CAMPriorityNotificationCenter _removeObserver:fromObserversByName:]

  • 4 CameraUI 0x1affb81a8 -[CAMPriorityNotificationCenter removeObserver:]

  • 5 CameraUI 0x1b0066510 -[CAMCaptureEngine dealloc]

  • 6 libsystem_blocks.dylib 0x1cfcbc784 _Block_release

  • 7 libdispatch.dylib 0x18750a290 _dispatch_source_handler_dispose

  • 8 libdispatch.dylib 0x18750935c _dispatch_source_invoke$VARIANT$armv81

  • 9 libdispatch.dylib 0x1874fc210 _dispatch_lane_serial_drain$VARIANT$armv81

  • 10 libdispatch.dylib 0x1874fce2c _dispatch_lane_invoke$VARIANT$armv81

  • 11 libdispatch.dylib 0x18750666c _dispatch_workloop_worker_thread

  • 12 libsystem_pthread.dylib 0x1cfd355bc _pthread_wqthread

  • 13 libsystem_pthread.dylib 0x1cfd3886c start_wqthread

Crashed: com.google.firebase.crashlytics.ios.exception SIGABRT ABORT 0x00000001b36927b0 FIRCLSProcessRecordAllThreads keyboard_arrow_down

Exactly same issue here (by FB Crashlytics) with capacitor @3.1.2, node @14.17. A lot of my users are affected by this unrecoverable issue ..

I have the same problem,But I don't know how to solve it

It seems to be UIImagePickerController viewDidDisappear when CAMPersistenceController dealloc.

* thread #1, queue = 'com.apple.main-thread'
    frame #0: 0x00000001b07a4100 libobjc.A.dylib`objc_msgSend + 32
    frame #1: 0x000000019e677dc0 UIKitCore`__UIViewWillBeRemovedFromSuperview + 1080
    frame #2: 0x000000019e67781c UIKitCore`-[UIView(Hierarchy) removeFromSuperview] + 96
    frame #3: 0x000000019e660010 UIKitCore`-[UIView dealloc] + 396
    frame #4: 0x00000001c5ea4d30 CameraUI`-[CAMViewfinderViewController .cxx_destruct] + 1408
    frame #5: 0x00000001b07a7b10 libobjc.A.dylib`object_cxxDestructFromClass(objc_object*, objc_class*) + 112
    frame #6: 0x00000001b07be840 libobjc.A.dylib`objc_destructInstance + 80
    frame #7: 0x00000001b07c580c libobjc.A.dylib`_objc_rootDealloc + 80
    frame #8: 0x000000019e17965c UIKitCore`-[UIResponder dealloc] + 156
    frame #9: 0x000000019da1b64c UIKitCore`-[UIViewController dealloc] + 1288
    frame #10: 0x00000001c5e72744 CameraUI`-[CAMViewfinderViewController dealloc] + 196
    frame #11: 0x00000001c5fc296c CameraUI`-[CAMCameraViewController .cxx_destruct] + 72
    frame #12: 0x00000001b07a7b10 libobjc.A.dylib`object_cxxDestructFromClass(objc_object*, objc_class*) + 112
    frame #13: 0x00000001b07be840 libobjc.A.dylib`objc_destructInstance + 80
    frame #14: 0x00000001b07c580c libobjc.A.dylib`_objc_rootDealloc + 80
    frame #15: 0x000000019e17965c UIKitCore`-[UIResponder dealloc] + 156
    frame #16: 0x000000019da1b64c UIKitCore`-[UIViewController dealloc] + 1288
    frame #17: 0x00000001c5fb9b58 CameraUI`-[CAMCameraViewController dealloc] + 100
  * frame #18: 0x000000019d93df64 UIKitCore`-[UIImagePickerController viewDidDisappear:] + 264
    frame #19: 0x000000019da248b0 UIKitCore`-[UIViewController _setViewAppearState:isAnimating:] + 368
    frame #20: 0x000000019da256a0 UIKitCore`-[UIViewController __viewDidDisappear:] + 144
    frame #21: 0x000000019da257b8 UIKitCore`-[UIViewController _endAppearanceTransition:] + 224
    frame #22: 0x000000019d900760 UIKitCore`__48-[UIPresentationController transitionDidFinish:]_block_invoke + 296
    frame #23: 0x000000019d9004a0 UIKitCore`-[UIPresentationController transitionDidFinish:] + 996
    frame #24: 0x000000019d90ac78 UIKitCore`-[_UICurrentContextPresentationController transitionDidFinish:] + 44
    frame #25: 0x000000019d904ca4 UIKitCore`__56-[UIPresentationController runTransitionForCurrentState]_block_invoke.528 + 212
    frame #26: 0x000000019da498f8 UIKitCore`-[_UIViewControllerTransitionContext completeTransition:] + 112
    frame #27: 0x000000019e64bd28 UIKitCore`-[UITransitionView notifyDidCompleteTransition:] + 244
    frame #28: 0x000000019e64b9d4 UIKitCore`-[UITransitionView _didCompleteTransition:] + 1136
    frame #29: 0x000000019e6838ec UIKitCore`-[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 724
    frame #30: 0x000000019e655c08 UIKitCore`-[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 248
    frame #31: 0x000000019e656170 UIKitCore`-[UIViewAnimationState animationDidStop:finished:] + 248
    frame #32: 0x000000019e6562d4 UIKitCore`-[UIViewAnimationState animationDidStop:finished:] + 604
    frame #33: 0x000000019ebc0474 QuartzCore`CA::Layer::run_animation_callbacks(void*) + 280
    frame #34: 0x0000000108b596c0 libdispatch.dylib`_dispatch_client_callout + 20
    frame #35: 0x0000000108b68f34 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 1000
    frame #36: 0x000000019b70911c CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
    frame #37: 0x000000019b703120 CoreFoundation`__CFRunLoopRun + 2508
    frame #38: 0x000000019b70221c CoreFoundation`CFRunLoopRunSpecific + 600
    frame #39: 0x00000001b32ce784 GraphicsServices`GSEventRunModal + 164
    frame #40: 0x000000019e142ee8 UIKitCore`-[UIApplication _run] + 1072
    frame #41: 0x000000019e14875c UIKitCore`UIApplicationMain + 168
    frame #42: 0x0000000102754cb8 Runner`main at AppDelegate.swift:5:13
    frame #43: 0x000000019b3c26b0 libdyld.dylib`start + 4
* thread #123, queue = 'com.apple.camera.capture-engine.results-queue', stop reason = signal SIGABRT
  * frame #0: 0x00000001c96e2414 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x00000001e723cb50 libsystem_pthread.dylib`pthread_kill + 272
    frame #2: 0x00000001a4bbbb74 libsystem_c.dylib`abort + 104
    frame #3: 0x00000001b08aecf8 libc++abi.dylib`abort_message + 132
    frame #4: 0x00000001b089fe4c libc++abi.dylib`demangling_terminate_handler() + 308
    frame #5: 0x00000001b07a8f64 libobjc.A.dylib`_objc_terminate() + 144
    frame #6: 0x00000001b08ae0e0 libc++abi.dylib`std::__terminate(void (*)()) + 20
    frame #7: 0x00000001b08b0eb0 libc++abi.dylib`__cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 36
    frame #8: 0x00000001b08b0e5c libc++abi.dylib`__cxa_throw + 140
    frame #9: 0x00000001b07a8d7c libobjc.A.dylib`objc_exception_throw + 360
    frame #10: 0x000000019b78d170 CoreFoundation`__NSFastEnumerationMutationHandler + 124
    frame #11: 0x00000001c5eb19e0 CameraUI`-[CAMPriorityNotificationCenter _removeObserver:fromObserversByName:] + 408
    frame #12: 0x00000001c5eb1d24 CameraUI`-[CAMPriorityNotificationCenter removeObserver:] + 216
    frame #13: 0x00000001c5ee0ec0 CameraUI`-[CAMPersistenceController dealloc] + 72
    frame #14: 0x000000019b6a79f8 CoreFoundation`__RELEASE_OBJECTS_IN_THE_ARRAY__ + 116
    frame #15: 0x000000019b66a740 CoreFoundation`-[__NSArrayM dealloc] + 184
    frame #16: 0x00000001c5f7d14c CameraUI`-[CAMCaptureEngine .cxx_destruct] + 176
    frame #17: 0x00000001b07a7b10 libobjc.A.dylib`object_cxxDestructFromClass(objc_object*, objc_class*) + 112
    frame #18: 0x00000001b07be840 libobjc.A.dylib`objc_destructInstance + 80
    frame #19: 0x00000001b07c580c libobjc.A.dylib`_objc_rootDealloc + 80
    frame #20: 0x00000001c5f6c07c CameraUI`-[CAMCaptureEngine dealloc] + 168
    frame #21: 0x00000001e71d0764 libsystem_blocks.dylib`_Block_release + 200
    frame #22: 0x0000000108b72a18 libdispatch.dylib`_dispatch_source_handler_dispose + 36
    frame #23: 0x0000000108b717ec libdispatch.dylib`_dispatch_source_invoke + 1456
    frame #24: 0x0000000108b61180 libdispatch.dylib`_dispatch_lane_serial_drain + 268
    frame #25: 0x0000000108b620c0 libdispatch.dylib`_dispatch_lane_invoke + 448
    frame #26: 0x0000000108b6e644 libdispatch.dylib`_dispatch_workloop_worker_thread + 1520
    frame #27: 0x00000001e723d814 libsystem_pthread.dylib`_pthread_wqthread + 276

Have you solved the problem?

Fatal Exception: NSGenericException *** Collection &lt;__NSArrayM: 0x28313ce10&gt; was mutated while being enumerated. -[CAMPriorityNotificationCenter _removeObserver:fromObserversByName:]
 
 
Q