Fatal Exception: NSInternalInconsistencyException
Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.
I am getting these occasional crashes in Firebase Crashlytics which I can't fathom out or reproduce (I'm new to debugging). Here is some of the info logged in Crashlytics but I can't see anything that looks familiar or that points to where its happening.
I'm guessing that something has happened in the background thread that shouldn't have but I have no idea where this is occurring in the app, hence I have not included any code.
Is there anything hidden in this list that I am missing that may give more of a clue? There are more threads listed in Crashlytics if needed but not much is in them.
Thanks in advance.
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0xa248 __exceptionPreprocess
1 libobjc.A.dylib 0x17a68 objc_exception_throw
2 CoreAutoLayout 0xde84 NSISLinExpReplaceVarWithVarPlusDelta
3 CoreAutoLayout 0x4e60 -[NSISEngine withBehaviors:performModifications:]
4 UIKitCore 0xac03c __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke
5 UIKitCore 0xd4544 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]
6 UIKitCore 0xd4154 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke
7 UIKitCore 0x1022750 -[UIView _postMovedFromSuperview:]
8 UIKitCore 0x1ed38 -[UIView(Internal) _addSubview:positioned:relativeTo:]
9 UIKitCore 0x508b88 -[_UITextLayoutCanvasView textViewportLayoutController:configureRenderingSurfaceForTextLayoutFragment:]
10 UIFoundation 0xb299c __48-[NSTextViewportLayoutController layoutViewport]_block_invoke_4
11 UIFoundation 0x5f720 __80-[NSTextLayoutManager enumerateViewportElementsFromLocation:options:usingBlock:]_block_invoke
12 UIFoundation 0x36ea8 __83-[NSTextLayoutManager enumerateTextLayoutFragmentsFromLocation:options:usingBlock:]_block_invoke_2
13 CoreFoundation 0xa760 __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__
14 CoreFoundation 0x378ec -[__NSSingleObjectArrayI enumerateObjectsWithOptions:usingBlock:]
15 UIFoundation 0x36b78 __83-[NSTextLayoutManager enumerateTextLayoutFragmentsFromLocation:options:usingBlock:]_block_invoke
16 UIFoundation 0x20210 -[NSTextLayoutManager enumerateTextLayoutFragmentsFromLocation:options:usingBlock:]
17 UIFoundation 0x1ff70 -[NSTextLayoutManager enumerateViewportElementsFromLocation:options:usingBlock:]
18 UIFoundation 0x1fa88 -[NSTextViewportLayoutController layoutViewport]
19 UIKitCore 0x316d0 +[UIView(Animation) performWithoutAnimation:]
20 UIKitCore 0x8af4 -[_UITextLayoutCanvasView layoutSubviews]
21 UIKitCore 0x4cec -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
22 QuartzCore 0xa4e8 CA::Layer::layout_if_needed(CA::Transaction*)
23 QuartzCore 0x1db9c CA::Layer::layout_and_display_if_needed(CA::Transaction*)
24 QuartzCore 0x2f098 CA::Context::commit_transaction(CA::Transaction*, double, double*)
25 QuartzCore 0x663c4 CA::Transaction::commit()
26 QuartzCore 0xb6658 CA::Transaction::release_thread(void*)
27 libsystem_pthread.dylib 0x1bd8 _pthread_tsd_cleanup
28 libsystem_pthread.dylib 0x4674 _pthread_exit
29 libsystem_pthread.dylib 0x10e0 pthread_main_np
30 libsystem_pthread.dylib 0xe80 _pthread_wqthread
31 libsystem_pthread.dylib 0xb98 start_wqthread
com.apple.main-thread
0 libsystem_kernel.dylib 0xb48 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x13008 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x13248 mach_msg_overwrite + 388
3 libsystem_kernel.dylib 0x108c mach_msg + 24
4 CoreFoundation 0x7ae00 __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x7c044 __CFRunLoopRun + 1232
6 CoreFoundation 0x811e4 CFRunLoopRunSpecific + 612
7 GraphicsServices 0x1368 GSEventRunModal + 164
8 UIKitCore 0x3a2d88 -[UIApplication _run] + 888
9 UIKitCore 0x3a29ec UIApplicationMain + 340
10 SwiftUI 0x1dace8 OUTLINED_FUNCTION_895 + 2424
11 SwiftUI 0x137c24 block_copy_helper.1 + 388
12 SwiftUI 0x120b44 OUTLINED_FUNCTION_901 + 2804
13 MyApp 0x496c main + 4372253036 (<compiler-generated>:4372253036)
14 ??? 0x1d3e95948 (Missing)