react-native-picker / picker

Picker is a cross-platform UI component for selecting an item from a list of options.
MIT License
1.47k stars 278 forks source link

Picker crashes silently in iOS #473

Open egealpay opened 1 year ago

egealpay commented 1 year ago

In debug mode, it happens most of the time. In release mode, it rarely happens.

Here is the logs:

2023-02-01 14:51:57.004808+0300 ...[83201:930071] *** Assertion failure in -[UIPickerTableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:], UITableView.m:16485
2023-02-01 14:51:57.015592+0300 ...[83201:930071] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView internal inconsistency: cannot create a cell with a nil index path for global row 8.'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000011d56f8ab __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x0000000112636ba3 objc_exception_throw + 48
    2   Foundation                          0x00000001158b90cc _userInfoForFileAndLine + 0
    3   UIKitCore                           0x0000000141639d1e -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 2289
    4   UIKitCore                           0x00000001415fe8aa -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] + 797
    5   UIKitCore                           0x00000001415ff1e4 -[UITableView _updateVisibleCellsNow:] + 1838
    6   UIKitCore                           0x0000000141621159 -[UITableView layoutSubviews] + 205
    7   UIKitCore                           0x000000014136c35f __35-[UIPickerTableView layoutSubviews]_block_invoke + 74
    8   UIKitCore                           0x00000001419cd9ef +[UIView(Animation) performWithoutAnimation:] + 84
    9   UIKitCore                           0x000000014136c30f -[UIPickerTableView layoutSubviews] + 80
    10  UIKitCore                           0x00000001419db59f -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2305
    11  QuartzCore                          0x000000011403c02c _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 526
    12  QuartzCore                          0x00000001140475b9 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 65
    13  QuartzCore                          0x0000000113f58b0c _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 626
    14  QuartzCore                          0x0000000113f9069b _ZN2CA11Transaction6commitEv + 735
    15  QuartzCore                          0x0000000113f91b64 _ZN2CA11Transaction25flush_as_runloop_observerEb + 60
    16  CoreFoundation                      0x000000011d4ce055 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    17  CoreFoundation                      0x000000011d4c89c2 __CFRunLoopDoObservers + 515
    18  CoreFoundation                      0x000000011d4c8f0d __CFRunLoopRun + 1161
    19  CoreFoundation                      0x000000011d4c86a7 CFRunLoopRunSpecific + 560
    20  GraphicsServices                    0x000000012111328a GSEventRunModal + 139
    21  UIKitCore                           0x00000001413a8ad3 -[UIApplication _run] + 994
    22  UIKitCore                           0x00000001413ad9ef UIApplicationMain + 123
    23  ...                              0x00000001042554f8 main + 104
    24  dyld                                0x000000010fd352bf start_sim + 10
    25  ???                                 0x000000020795e310 0x0 + 8717198096
)
libc++abi: terminating with uncaught exception of type NSException
Message from debugger: Terminated due to signal 6
icsdevs commented 1 year ago

I am also getting this error but only when I have more than ~50 options in the picker. It doesn't seem to have any hard limit but the more options you add, the more often it will crash with the above error.

egealpay commented 1 year ago

I am also getting this error but only when I have more than ~50 options in the picker. It doesn't seem to have any hard limit but the more options you add, the more often it will crash with the above error.

Interesting, I tried to reduce the number of options but it didn't help :/