mattermost / react-native-paste-input

React Native TextInput replacement to allow pasting files
MIT License
127 stars 19 forks source link

Crashing with error "CALayer position contains NaN" _UIEditMenuPresentation #18

Closed mfbx9da4 closed 1 year ago

mfbx9da4 commented 1 year ago

I haven't yet localized the cause but I'm getting the app is crashing with the following error in the simulator. Looks to be some issue with _UIEditMenuPresentation

Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan 438.667]. Layer: <CALayer:0x6000002514a0; position = CGPoint (0 0); bounds = CGRect (0 0; 121 48); delegate = <_UIEditMenuListView: 0x14e9dfc80; frame = (-60.5 -24; 121 48); alpha = 0; layer = <CALayer: 0x6000002514a0>>; sublayers = (<CALayer: 0x600000252280>); opaque = YES; opacity = 0; shadowOpacity = 0.25; shadowOffset = CGSize (0 3); shadowRadius = 12>'
CoreSimulator 857.14 - Device: iPhone 14 Pro (97873C50-4EDC-4624-9E2F-F53603845E9A) - Runtime: iOS 16.2 (20C52) - DeviceType: iPhone 14 Pro

Last Exception Backtrace:
0   CoreFoundation                         0x18040e7bc __exceptionPreprocess + 160
1   libobjc.A.dylib                        0x180051144 objc_exception_throw + 56
2   CoreFoundation                         0x18040e6d8 -[NSException initWithCoder:] + 0
3   QuartzCore                             0x187f531b0 -[CALayer setPosition:] + 364
4   UIKitCore                              0x116bb69b4 -[UIView setCenter:] + 284
5   UIKitCore                              0x115ea4f8c -[_UIEditMenuPresentation _displayMenu:reason:] + 1340
6   UIKitCore                              0x115ea4998 -[_UIEditMenuPresentation displayMenu:configuration:] + 60
7   UIKitCore                              0x116b85808 __58-[UIEditMenuInteraction presentEditMenuWithConfiguration:]_block_invoke + 168
8   UIKitCore                              0x116b86ce8 __80-[UIEditMenuInteraction _prepareMenuAtLocation:configuration:completionHandler:]_block_invoke + 88
9   UIKitCore                              0x11699dbf0 __133-[_UIContextMenuInteractionBasedTextContextInteraction _editMenuInteraction:menuForConfiguration:suggestedActions:completionHandler:]_block_invoke + 160
10  UIKitCore                              0x11699dcf0 -[_UIContextMenuInteractionBasedTextContextInteraction _querySelectionCommandsForConfiguration:suggestedActions:completionHandler:] + 224
11  UIKitCore                              0x11699db30 -[_UIContextMenuInteractionBasedTextContextInteraction _editMenuInteraction:menuForConfiguration:suggestedActions:completionHandler:] + 112
12  UIKitCore                              0x116b86c50 -[UIEditMenuInteraction _prepareMenuAtLocation:configuration:completionHandler:] + 248
13  UIKitCore                              0x116b855e4 -[UIEditMenuInteraction presentEditMenuWithConfiguration:] + 196
14  UIKitCore                              0x11699e1a8 -[_UIContextMenuInteractionBasedTextContextInteraction presentSelectionCommandsWithConfiguration:] + 76
15  UIKitCore                              0x1169d91fc -[UITextSelectionView _presentEditMenuWithPreferredDirection:replacements:] + 76
16  UIKitCore                              0x1169d8f90 -[UITextSelectionView _showCommandsWithReplacements:isForContextMenu:forDictation:arrowDirection:] + 900
17  UIKitCore                              0x1169d8ba8 __77-[UITextSelectionView _showCommandsWithReplacements:forDictation:afterDelay:]_block_invoke + 200
18  libdispatch.dylib                      0x180135768 _dispatch_client_callout + 16
19  libdispatch.dylib                      0x180139078 _dispatch_continuation_pop + 644
20  libdispatch.dylib                      0x18014e10c _dispatch_source_invoke + 1568
21  libdispatch.dylib                      0x180144e8c _dispatch_main_queue_drain + 824
22  libdispatch.dylib                      0x180144b44 _dispatch_main_queue_callback_4CF + 40
23  CoreFoundation                         0x180372ca4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
24  CoreFoundation                         0x18036d360 __CFRunLoopRun + 1956
25  CoreFoundation                         0x18036c7a4 CFRunLoopRunSpecific + 584
26  GraphicsServices                       0x188ff7c98 GSEventRunModal + 160
27  UIKitCore                              0x11673637c -[UIApplication _run] + 868
28  UIKitCore                              0x11673a374 UIApplicationMain + 124
29  Onin                                   0x100254ffc main + 96 (main.m:8)
30  dyld_sim                               0x109acdfa0 start_sim + 20
31  dyld                                   0x109c1de50 start + 2544
32  ???                             0x9f14800000000000 ???
enahum commented 1 year ago

Any pointers? can you share reproduction steps?

mfbx9da4 commented 1 year ago

Thanks for your prompt response.

There doesn't seem to be anything special about my setup so I'm surprised nobody else has reported this. Maybe something related to Xcode version, iOS version or something else. Could you give me any pointers about what the issue could be?

I could setup an example repo but I don't think it would be so useful to you right now.

enahum commented 1 year ago

Is really working just fine for us in our app so not entirely sure what may cause this

mfbx9da4 commented 1 year ago

Closing as I think it's likely something on our end and I've moved on to a different task so won't be providing more context