Netvent/storyly-sdk

iOS UICollectionView crash on 1.32.6

Closed this issue · 5 comments

vanab commented

Issue tracker is ONLY used for reporting iOS SDK related bugs.

Several issues have already been created with this problem. It has still not been fully fixed and is still recurring. This crash is top 1 (65% of all crashes!) in our crash statistics.

Environment Details

Storyly SDK Version: 1.32.6
Device OS Version: iOS 15, iOS 16

Stack Trace

Fatal Exception: NSInternalInconsistencyException
Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (16) must be equal to the number of items contained in that section before the update (8), plus or minus the number of items inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out). Collection view: <Storyly.StorylyGroupCollectionView: 0x12003c000; baseClass = UICollectionView; frame = (0 0; 390 844); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x28139c960>; backgroundColor = UIExtendedGrayColorSpace 0 1; layer = <CALayer: 0x281963380>; contentOffset: {0, 0}; contentSize: {3120, 844}; adjustedContentInset: {0, 0, 0, 0}; layout: <Storyly.AnimatedCollectionViewLayout: 0x124e58780>; dataSource: <Storyly.StorylyGroupCollectionView: 0x12003c000; baseClass = UICollectionView; frame = (0 0; 390 844); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x28139c960>; backgroundColor = UIExtendedGrayColorSpace 0 1; layer = <CALayer: 0x281963380>; contentOffset: {0, 0}; contentSize: {3120, 844}; adjustedContentInset: {0, 0, 0, 0}; layout: <Storyly.AnimatedCollectionViewLayout: 0x124e58780>; dataSource: <Storyly.StorylyGroupCollectionView: 0x12003c000>>>

Crashlytics - Stack trace
Application: our app
Platform: apple
Issue: fe741015e1cc320abea6275cd5f79a02
Session: 0e3fb3ddb01b4457a60adf3fbd09acd0_DNE_0_v2
Date: Tue Jun 27 2023 09:06:10 GMT+0200 

Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                   0x9d94 __exceptionPreprocess
1  libobjc.A.dylib                  0x183d0 objc_exception_throw
2  Foundation                       0x4e16cc _userInfoForFileAndLine
3  UIKitCore                        0x702470 -[UICollectionView _Bug_Detected_In_Client_Of_UICollectionView_Invalid_Number_Of_Items_In_Section:]
4  UIKitCore                        0x30db70 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:]
5  UIKitCore                        0x26badc -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:animationHandler:]
6  Storyly                          0x38f38 (Missing UUID 2c0116dedde8380eb961bc0e19c94240)
7  Storyly                          0x8e6d4 (Missing UUID 2c0116dedde8380eb961bc0e19c94240)
8  Storyly                          0xab210 (Missing UUID 2c0116dedde8380eb961bc0e19c94240)
9  libdispatch.dylib                0x2320 _dispatch_call_block_and_release
10 libdispatch.dylib                0x3eac _dispatch_client_callout
11 libdispatch.dylib                0x126a4 _dispatch_main_queue_drain
12 libdispatch.dylib                0x122f4 _dispatch_main_queue_callback_4CF
13 CoreFoundation                   0x98d18 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
14 CoreFoundation                   0x7a650 __CFRunLoopRun
15 CoreFoundation                   0x7f4dc CFRunLoopRunSpecific
16 GraphicsServices                 0x135c GSEventRunModal
17 UIKitCore                        0x39d37c -[UIApplication _run]
18 UIKitCore                        0x39cfe0 UIApplicationMain
19 Our App   0x18290 main + 19 (AppDelegate.swift:19)
20 ??? 

Same here! crash happens on 1.32.4 also

Same crash on 1.32.1

Hello @vanab, @artdima, @daniel-tavares-nl,

We've released Storyly iOS SDK 2.0.1 and Storyly iOS SDK 1.33.1. We've improved the codebase to prevent this crash.

Thanks

@yigcal Hey, thanks for this. do you know if 2.0.0 also have the fix for this?

@daniel-tavares-nl Yes, Storyly iOS SDK 2.0.1 also has this improvement.