SwiftUI crash only in iOS16.0 and iOS16.1

Hi, I just released a major update to my app that includes a lot of SwiftUI, with a minimum deployment target of iOS15. I've been tracking this one crash that only seems to happen for devices running iOS16 or iOS16.1. I can't track down what is causing this, but this is the crash report I get ... any tips would be helpful.

Here's the crash report which might help:

Date/Time:       2024-06-13T13:27:41.999Z
Launch Time:     2024-06-12T20:47:48Z
OS Version:      iPhone OS 16.1.1 (20B101)
Report Version:  104

Exception Type:  SIGTRAP
Exception Codes: TRAP_BRKPT at 0x18301cd7c
Crashed Thread:  0

Thread 0 Crashed:
0   libswiftCore.dylib                   0x000000018301cd7c Swift._assertionFailure(_: Swift.StaticString, _: Swift.String, file: Swift.StaticString, line: Swift.UInt, flags: Swift.UInt32) -> Swift.Never + 312
1   SwiftUI                              0x000000018e0bdc50 OUTLINED_FUNCTION_15 + 1196
2   SwiftUI                              0x000000018e0bdef4 OUTLINED_FUNCTION_15 + 1872
3   SwiftUI                              0x000000018d4f0508 OUTLINED_FUNCTION_2 + 9436
4   UIKitCore                            0x000000018b4200a0 -[UICollectionReusableView _preferredLayoutAttributesFittingAttributes:] + 140
5   UIKitCore                            0x000000018b4ac9ec -[UICollectionViewListCell _preferredLayoutAttributesFittingAttributes:] + 236
6   UIKitCore                            0x000000018b3806a8 -[UICollectionView _checkForPreferredAttributesInView:originalAttributes:] + 156
7   UIKitCore                            0x000000018b5114d4 -[UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:] + 800
8   UIKitCore                            0x000000018ba5abb4 -[UICollectionView _createAndAppendViewAnimationsForExistingAndDeletedAuxiliariesInCurrentUpdate:disappearingAnimations:animationsForOnScreenViews:newSubviewManager:oldVisibleViews:] + 1432
9   UIKitCore                            0x000000018b5170dc -[UICollectionView _viewAnimationsForCurrentUpdateWithCollectionViewAnimator:] + 356
10  UIKitCore                            0x000000018ba5d2b8 __102-[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:]_block_invoke.744 + 264
11  UIKitCore                            0x000000018b386564 +[UIView(Animation) performWithoutAnimation:] + 72
12  UIKitCore                            0x000000018b66873c -[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:] + 1384
13  UIKitCore                            0x000000018b667d58 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:] + 9016
14  UIKitCore                            0x000000018b5c57bc -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:animationHandler:] + 516
15  SwiftUI                              0x000000018d308674 OUTLINED_FUNCTION_7 + 10744
16  SwiftUI                              0x000000018cbffef8 OUTLINED_FUNCTION_326 + 7604
17  SwiftUI                              0x000000018cd4afa0 OUTLINED_FUNCTION_620 + 720
18  UIKitCore                            0x000000018b386564 +[UIView(Animation) performWithoutAnimation:] + 72
19  SwiftUI                              0x000000018d3084bc OUTLINED_FUNCTION_7 + 10304
20  SwiftUI                              0x000000018cc57234 OUTLINED_FUNCTION_263 + 2444
21  UIKitCore                            0x000000018ba5ea38 -[UICollectionView _updateAnimationDidStop:finished:] + 1228
22  UIKitCore                            0x000000018ba5e150 __147-[UICollectionView _startViewAnimationsWithContext:oldVisibleViews:reorderedViewAttributesTable:viewAnimator:viewAnimationsCompletedDispatchGroup:]_block_invoke + 32
23  UIKitCore                            0x000000018ba7d3f4 __47-[UICollectionViewAnimation startWithAnimator:]_block_invoke_3 + 268
24  UIKitCore                            0x000000018c389334 __UIVIEW_IS_EXECUTING_ANIMATION_COMPLETION_BLOCK__ + 32
25  UIKitCore                            0x000000018b426808 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 632
26  UIKitCore                            0x000000018b425764 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 432
27  UIKitCore                            0x000000018b424e84 -[UIViewAnimationState animationDidStop:finished:] + 192
28  QuartzCore                           0x000000018a838fec CA::Layer::run_animation_callbacks(void*) + 228
29  libdispatch.dylib                    0x0000000190771fdc _dispatch_client_callout + 16
30  libdispatch.dylib                    0x00000001907807f4 _dispatch_main_queue_drain + 924
31  libdispatch.dylib                    0x0000000190780444 _dispatch_main_queue_callback_4CF + 40
32  CoreFoundation                       0x00000001892326f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
33  CoreFoundation                       0x0000000189214058 __CFRunLoopRun + 2032
34  CoreFoundation                       0x0000000189218ed4 CFRunLoopRunSpecific + 608
35  GraphicsServices                     0x00000001c2516368 GSEventRunModal + 160
36  UIKitCore                            0x000000018b6f73d0 -[UIApplication _run] + 884
37  UIKitCore                            0x000000018b6f7034 UIApplicationMain + 336
38  CJournal                             0x0000000102ae4060 main (main.m:20)
39  ???                                  0x00000001a7880960 0x0 + 0
Answered by zulfishah in 796485022

Just for reference: Apple DTS acknowledged a crash issue with SwiftUI Lists (specifically with section headers) that was fixed in iOS16.2. Ideally, this would have been documented or mentioned somewhere so I could've set the minimum deployment target to 16.2.

Accepted Answer

Just for reference: Apple DTS acknowledged a crash issue with SwiftUI Lists (specifically with section headers) that was fixed in iOS16.2. Ideally, this would have been documented or mentioned somewhere so I could've set the minimum deployment target to 16.2.

SwiftUI crash only in iOS16.0 and iOS16.1
 
 
Q