React-native-image-crop-picker: ios App crash at once

Created on 22 Oct 2019  路  4Comments  路  Source: ivpusic/react-native-image-crop-picker

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.26.1?
  • react-native v0.61.2

Platform

Tell us to which platform this issue is related

  • iOS

Actual behaviour

"libc++abi.dylib: terminating with uncaught exception of type NSException"

Steps to reproduce

  1. yarn add react-native-image-crop-picker

  2. cd ios && pod install

  3. pod 'QBImagePickerController', :path => '../node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePickerController.podspec'

  4. added NSPhotoLibraryUsageDescription
    NSMicrophoneUsageDescription
    NSCameraUsageDescription into info.plist

  5. react-native run-ios

after these as it didn't work, I tried to use react-native link react-native-image-crop-picker
cleaned, ios build, erase from simulator, nothing worked.

Screenshot 2019-10-23 at 12 34 47 PM

Podfile content:

latform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'xycabs' do
# Pods for xcabs
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'Firebase/Core', '~> 6.3.0'
pod 'Firebase/Auth', '~> 6.3.0'
pod 'Firebase/Messaging', '~> 6.3.0'
pod 'Firebase/Storage', '~> 6.3.0'
pod 'Firebase/Firestore', '~> 6.3.0'

pod 'QBImagePickerController', :path => '../node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePickerController.podspec'

target 'xycabsTests' do
inherit! :search_paths
# Pods for testing
end

use_native_modules!
end

Most helpful comment

Tried the solution suggested by @devpascoe, no luck whatsoever

  • React Native 0.61.0
  • Library Version: 0.28.0

Same error:

-[NSNull length]: unrecognized selector sent to instance 0x1f6ed7c00
** Terminating app due to uncaught exception 'NSInvalidArgumentException'

All 4 comments

hmmm i may be experiencing something similar. I have existing projects that all work fine however for a new project created with Xcode 11.2 i get this issue. Wondering if its related to all the new Application Scene Manifest stuff in info.plist and the new iOS 13 methods in AppDelegate under UISceneSession lifecycle that get scaffolded in with a new project.

Looking more at the error:
Is the library calling a method on window that no longer exists?

Happens on ImageCropPicker.openCamera({ and ImageCropPicker.openPicker({

Update: got it going with...
AppDelegate.h add a missing
@property (strong, nonatomic) UIWindow *window;

AppDelegate.m
Comment out all the UISceneSession lifecycle events relating to UISceneConfiguration and UISceneSession

Info.plist
Delete the property dictionary: Application Scene Manifest

Those actions should revert the project to support pre iOS 13. With the new version they do away with window and its all about Scene. Performing above makes the project backwards compatible hence why my old projects remained functional.

At some stage the getRootVC method in ImageCropPicker.m will need to be updated to support this new way of obtaining the rootViewController.

Hey @amitbravo did solution provided by @devpascoe solve your problem and you are still using this library?
Or you come up with something else? Thanks

Tried the solution suggested by @devpascoe, no luck whatsoever

  • React Native 0.61.0
  • Library Version: 0.28.0

Same error:

-[NSNull length]: unrecognized selector sent to instance 0x1f6ed7c00
** Terminating app due to uncaught exception 'NSInvalidArgumentException'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

althurzard picture althurzard  路  3Comments

xuchao321 picture xuchao321  路  3Comments

DISKONEKTeD picture DISKONEKTeD  路  3Comments

Phenek picture Phenek  路  3Comments

co-de picture co-de  路  3Comments