Skip to content

Crash on [UICollectionView cellForItemAtIndexPath] #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xv-sufiyan-yasa opened this issue Apr 11, 2025 · 5 comments
Closed

Crash on [UICollectionView cellForItemAtIndexPath] #510

xv-sufiyan-yasa opened this issue Apr 11, 2025 · 5 comments
Assignees
Labels

Comments

@xv-sufiyan-yasa
Copy link

Rerror message:

Fatal Exception: NSInternalInconsistencyException
Expected dequeued view to be returned to the collection view in preparation for display. When the collection view's data source is asked to provide a view for a given index path, ensure that a single view is dequeued and returned to the collection view. Avoid dequeuing views without a request from the collection view. For retrieving an existing view in the collection view, use -[UICollectionView cellForItemAtIndexPath:] or -[UICollectionView supplementaryViewForElementKind:atIndexPath:]. Dequeued view: <IBGPickerCollectionViewCell: 0x13ac61200; baseClass = UICollectionViewCell; frame = (94.3333 467.667; 92.5 92.5); clipsToBounds = YES; layer = <CALayer: 0x3025eb1e0>>; Collection view: <UICollectionView: 0x139714e00; frame = (0 0; 375 812); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x3031b22e0>; backgroundColor = <UIDynamicProviderColor: 0x3027001e0; provider = <NSMallocBlock: 0x302c69c80>>; layer = <CALayer: 0x302213ec0>; contentOffset: {0, -90.666666666666671}; contentSize: {375, 560}; adjustedContentInset: {94, 0, 44, 0}; layout: <UICollectionViewFlowLayout: 0x1397dd400>; dataSource: <IBGPickerDataSource: 0x303692240>>

Stack trace:

Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x2d5fc __exceptionPreprocess
1  libobjc.A.dylib                0x31244 objc_exception_throw
2  Foundation                     0x82dec0 _userInfoForFileAndLine
3  UIKitCore                      0x9a2d24 __43-[UICollectionView _updateVisibleCellsNow:]_block_invoke.499
4  UIKitCore                      0x1a83d8 -[_UICollectionViewSubviewManager removeAllDequeuedViewsWithEnumerator:]
5  UIKitCore                      0x1a50d8 -[UICollectionView _updateVisibleCellsNow:]
6  UIKitCore                      0x33ebc8 -[UICollectionView layoutSubviews]
7  UIKitCore                      0x37814 -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
8  QuartzCore                     0x90498 CA::Layer::layout_if_needed(CA::Transaction*)
9  QuartzCore                     0x90024 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
10 QuartzCore                     0xe50c4 CA::Context::commit_transaction(CA::Transaction*, double, double*)
11 QuartzCore                     0x5bd8c CA::Transaction::commit()
12 QuartzCore                     0x5b798 CA::Transaction::flush_as_runloop_observer(bool)
13 UIKitCore                      0x9f3d0 _UIApplicationFlushCATransaction
14 UIKitCore                      0x9c89c __setupUpdateSequence_block_invoke_2
15 UIKitCore                      0x9c710 _UIUpdateSequenceRun
16 UIKitCore                      0x9f040 schedulerStepScheduledMainSection
17 UIKitCore                      0x9cc5c runloopSourceCallback
18 CoreFoundation                 0x73f4c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
19 CoreFoundation                 0x73ee0 __CFRunLoopDoSource0
20 CoreFoundation                 0x76b40 __CFRunLoopDoSources0
21 CoreFoundation                 0x75d3c __CFRunLoopRun
22 CoreFoundation                 0xc8284 CFRunLoopRunSpecific
23 GraphicsServices               0x14c0 GSEventRunModal
24 UIKitCore                      0x3ee674 -[UIApplication _run]
25 UIKitCore                      0x14e88 UIApplicationMain
26 ExpressVPN                     0x1d16c main + 14 (main.m:14)
27 ???                            0x1a9d81de8 (Missing)
@mohasalahh
Copy link
Member

Thank you for reporting this. Based on the information provided, this appears to be an internal issue within your application and is not related to the Instabug SDK. Please feel free to reach out if you find any evidence that suggests otherwise.

@xv-sufiyan-yasa
Copy link
Author

xv-sufiyan-yasa commented Apr 21, 2025

Thank you for the response @mohasalahh

I suggested that this is related to Instabug due to the following evidence:

  1. My application does not use UICollectionView
  2. The error message above ( in my original message ), hints the following 2 classes which is unknown to us IBGPickerCollectionViewCell and IBGPickerDataSource

@mohasalahh
Copy link
Member

Hi! Thanks for getting back to us with these details. Could you please provide the steps to reproduce the issue, the current SDK version you’re using, and the iOS device version where you’re encountering the crash?

@mohasalahh mohasalahh reopened this Apr 21, 2025
@mohasalahh mohasalahh added the Bug label Apr 21, 2025
@mohasalahh mohasalahh self-assigned this Apr 21, 2025
@xv-sufiyan-yasa
Copy link
Author

Thanks, please find the details below

Could you please provide the steps to reproduce the issue
The crash is non deterministic.
The steps to produce this was to open the instabug form which is triggered by Instabug.show()

the current SDK version you’re using
Instabug (14.2.0)

and the iOS device version
iPhone 13 Mini, iOS 18.3.2

@mohasalahh
Copy link
Member

Thanks for the details!

We’ve released a fix for this issue in SDK version 15.0.0. Please update to the latest version and give it a try. If the issue persists, feel free to reach out again — we’re happy to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants