react-native-image-crop-picker icon indicating copy to clipboard operation
react-native-image-crop-picker copied to clipboard

'NSInvalidArgumentException', reason: '-[__NSCFBoolean isEqualToString:]: unrecognized selector sent to instance

Open oleg-moseyko opened this issue 3 years ago • 1 comments

Version

Tell us which versions you are using:

"react": "17.0.2",
"react-native": "0.67.3",
"react-native-image-crop-picker": "^0.37.3"

Platform

Tell us to which platform this issue is related

  • iOS 15.2

Actual behaviour

Crash app.

Steps to reproduce

  1. Open picker.

  2. Click to 'Recents'

Attachments

Снимок экрана 2022-02-23 в 08 13 15 ### Code
const onUploadPress = async (options) => {
  try {
    ImagePicker.openPicker({
      multiple: true,
      maxFiles: 10000,
      useFrontCamera: true,
      // smartAlbums: true,
      sortOrder: true,
      mediaType: 'any',
      cropping: true,
    })
            .then(async (files) => {
            })
            .catch((e) => {
              console.log('ImagePicker.openPicker: error:', e.message);
            });
  } catch (error) {
    console.log('ImagePicker.onUploadPress: error:', error);
  }
};

// stacktrace or any other useful debug info flipper: FlipperClient::addPlugin Inspector flipper: FlipperClient::addPlugin Preferences flipper: FlipperClient::addPlugin React flipper: FlipperClient::addPlugin Network 2022-02-23 08:04:07.800958+0200 Picker[5949:1357061] [native] Running application Picker ({ initialProps = { }; rootTag = 1; }) 2022-02-23 08:04:08.116086+0200 Picker[5949:1357464] [javascript] Running "Picker" with {"rootTag":1,"initialProps":{}} 2022-02-23 08:04:08.118391+0200 Picker[5949:1357448] [connection] nw_socket_handle_socket_event [C5.1:1] Socket SO_ERROR [61: Connection refused] 2022-02-23 08:04:08.120888+0200 Picker[5949:1357448] [connection] nw_socket_handle_socket_event [C5.2:1] Socket SO_ERROR [61: Connection refused] 2022-02-23 08:04:08.121852+0200 Picker[5949:1357446] [connection] nw_connection_get_connected_socket [C5] Client called nw_connection_get_connected_socket on unconnected nw_connection 2022-02-23 08:04:08.122050+0200 Picker[5949:1357446] TCP Conn 0x6000011e4420 Failed : error 0:61 [61] 2022-02-23 08:04:12.050315+0200 Picker[5949:1357061] -[__NSCFBoolean isEqualToString:]: unrecognized selector sent to instance 0x7fff8a8454e8 2022-02-23 08:04:12.123934+0200 Picker[5949:1357061] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFBoolean isEqualToString:]: unrecognized selector sent to instance 0x7fff8a8454e8' *** First throw call stack: ( 0 CoreFoundation 0x00007fff203feba4 __exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007fff201a1be7 objc_exception_throw + 48 2 CoreFoundation 0x00007fff2040d811 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0 3 CoreFoundation 0x00007fff204030ac forwarding + 1433 4 CoreFoundation 0x00007fff204051d8 _CF_forwarding_prep_0 + 120 5 Picker 0x000000010c9f49e4 -[QBAssetsViewController updateFetchRequest] + 500 6 Picker 0x000000010c9f3f44 -[QBAssetsViewController setAssetCollection:] + 84 7 Picker 0x000000010c9eea17 -[QBAlbumsViewController prepareForSegue:sender:] + 311 8 UIKitCore 0x00007fff251fce7a -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 156 9 UIKitCore 0x00007fff251fcdb0 -[UIStoryboardSegueTemplate _perform:] + 82 10 UIKitCore 0x00007fff251fd008 -[UIStoryboardSegueTemplate perform:] + 157 11 UIKitCore 0x00007fff252a693a -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:isCellMultiSelect:deselectPrevious:] + 1751 12 UIKitCore 0x00007fff252a6248 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 94 13 UIKitCore 0x00007fff252a6c64 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 334 14 UIKitCore 0x00007fff255b3a37 -[_UIAfterCACommitBlock run] + 54 15 UIKitCore 0x00007fff255b3f17 -[_UIAfterCACommitQueue flush] + 190 16 libdispatch.dylib 0x000000010f2d8848 _dispatch_call_block_and_release + 12 17 libdispatch.dylib 0x000000010f2d9a2c _dispatch_client_callout + 8 18 libdispatch.dylib 0x000000010f2e81f1 _dispatch_main_queue_callback_4CF + 1197 19 CoreFoundation 0x00007fff2036c84d CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 20 CoreFoundation 0x00007fff203670aa __CFRunLoopRun + 2772 21 CoreFoundation 0x00007fff203660f3 CFRunLoopRunSpecific + 567 22 GraphicsServices 0x00007fff2c995cd3 GSEventRunModal + 139 23 UIKitCore 0x00007fff25059f42 -[UIApplication _run] + 928 24 UIKitCore 0x00007fff2505eb5e UIApplicationMain + 101 25 Picker 0x000000010c513ac8 main + 104 26 dyld 0x000000010efd3ee9 start_sim + 10 27 ??? 0x000000011b76d4fe 0x0 + 4755739902 ) libc++abi: terminating with uncaught exception of type NSException dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/olegmoseyko/Library/Developer/Xcode/DerivedData/Picker-cikfltyrytpvvjbrikgkllufbubt/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib DYLD_FRAMEWORK_PATH=/Users/olegmoseyko/Library/Developer/Xcode/DerivedData/Picker-cikfltyrytpvvjbrikgkllufbubt/Build/Products/Debug-iphonesimulator terminating with uncaught exception of type NSException *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFBoolean isEqualToString:]: unrecognized selector sent to instance 0x7fff8a8454e8' CoreSimulator 783.5 - Device: iPhone 13 Pro Max (EBE87F39-E549-453B-9FC1-B6CF5B32DD02) - Runtime: iOS 15.2 (19C51) - DeviceType: iPhone 13 Pro Max (lldb) Love react-native-image-crop-picker? Please consider supporting our collective: 👉 https://opencollective.com/react-native-image-crop-picker/donate

oleg-moseyko avatar Feb 23 '22 06:02 oleg-moseyko

I have the same issue. I don't know how to reproduce it.

100% iPhone 100% iOS 15.5.0

-[PHPhotoLibrary presentLimitedLibraryPickerFromViewController:]: unrecognized selector sent to instance 0x109edcef0


Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x99288 __exceptionPreprocess
1  libobjc.A.dylib                0x16744 objc_exception_throw
2  CoreFoundation                 0x176fc4 +[NSObject(NSObject) _copyDescription]
3  CoreFoundation                 0x2de98 ___forwarding___
4  CoreFoundation                 0x2cf70 _CF_forwarding_prep_0
5  X                              0x34c1e0 __49-[QBAlbumsViewController managePermissionAction:]_block_invoke + 290 (QBAlbumsViewController.m:290)
6  UIKitCore                      0x154a8c -[UIAlertController _invokeHandlersForAction:]
7  UIKitCore                      0x7298f0 __103-[UIAlertController _dismissAnimated:triggeringAction:triggeredByPopoverDimmingView:dismissCompletion:]_block_invoke.469
8  UIKitCore                      0x3a5ab8 -[UIPresentationController transitionDidFinish:]
9  UIKitCore                      0x8ef42c __56-[UIPresentationController runTransitionForCurrentState]_block_invoke.461
10 UIKitCore                      0x23f168 -[_UIViewControllerTransitionContext completeTransition:]
11 UIKitCore                      0x12a8cdc __UIVIEW_IS_EXECUTING_ANIMATION_COMPLETION_BLOCK__
12 UIKitCore                      0x2c2ca4 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:]
13 UIKitCore                      0x18eb3c -[UIViewAnimationState sendDelegateAnimationDidStop:finished:]
14 UIKitCore                      0x1a333c -[UIViewAnimationState animationDidStop:finished:]
15 UIKitCore                      0x1a34a4 -[UIViewAnimationState animationDidStop:finished:]
16 QuartzCore                     0xcb320 CA::Layer::run_animation_callbacks(void*)
17 libdispatch.dylib              0x3a30 _dispatch_client_callout
18 libdispatch.dylib              0x11f48 _dispatch_main_queue_drain
19 libdispatch.dylib              0x11b98 _dispatch_main_queue_callback_4CF
20 CoreFoundation                 0x51800 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
21 CoreFoundation                 0xb704 __CFRunLoopRun
22 CoreFoundation                 0x1ebc8 CFRunLoopRunSpecific
23 GraphicsServices               0x1374 GSEventRunModal
24 UIKitCore                      0x514648 -[UIApplication _run]
25 UIKitCore                      0x295d90 UIApplicationMain
26 X                              0x6498 main + 7 (main.m:7)
27 ???                            0x101c35ce4 (Missing)

RodolfoGS avatar Jun 30 '22 16:06 RodolfoGS

@RodolfoGS I'm getting the same error as you and am able to reproduce.

  • In iOS Settings give your app Selected Photos permission and select no images.
  • Open your app and open image picker
  • Select Keep selected photos
  • Press MANAGE
  • Select Choose more photos
  • App will crash with above exception

Hope this helps

markholland avatar Oct 14 '22 10:10 markholland

@markholland I did that steps but I'm not be able to crash the app

RodolfoGS avatar Oct 14 '22 16:10 RodolfoGS

@markholland @RodolfoGS @oleg-moseyko I was able to fix this issue. and I have raised a pr Please Have a look

damithg-dev avatar Oct 18 '22 09:10 damithg-dev

For anyone needing this fix you should know that this bug still occurs on iPad with the current release. You have to apply this patch as well https://github.com/ivpusic/react-native-image-crop-picker/issues/1765#issuecomment-1171403844

markholland avatar Nov 03 '22 09:11 markholland