react-native-image-crop-picker
react-native-image-crop-picker copied to clipboard
IOS ImagePicker.openCamera error
Version
Tell us which versions you are using:
- react-native-image-crop-picker v0.19.0
- react-native v0.49
Platform
IOS 平台下 报错 undefined is not an object (evaluating'_reactNativeImageCropPicker2.default.opCamera)
- iOS
- Android
Expected behaviour
Actual behaviour
Steps to reproduce
Attachments
// stacktrace or any other useful debug info
Love react-native-image-crop-picker? Please consider supporting our collective: 👉 https://opencollective.com/react-native-image-crop-picker/donate
can you please provide more details?
I'm guessing this is the same as, or at least very similar to, https://github.com/ivpusic/react-native-image-crop-picker/issues/274 and https://github.com/ivpusic/react-native-image-crop-picker/issues/132
I am having the same problem. ImagePicker is undefined. I have tried so many things now with pods strategy, seems like I have to try manual install... Linking seems to work fine (rnpm-install info iOS module react-native-image-crop-picker has been successfully linked
).
I am using react-native 0.51.0, react-native-image-crop-picker 0.19.1 and Pod installs QBImagePickerController (3.4.0) and RSKImageCropper (1.6.3).
I am using the iOS simulator though, because I don't have easy access to an iPhone. But it should not be undefined on the simulator, I hope?
Update: Seems like I might have found a solution (or hack?): In XCode, I selected my target, and under the General tab I scrolled down to Linked Frameworks and Libraries. I pressed the plus button and found libimageCropPicker.a
in the Workspace folder. After adding this, ImagePicker is no longer undefined! Instead, I get the warning Error: Cannot run camera on simulator
, which is self-explanatory :).
+1 on this. First time getting this.
Hi, Android work fine, IOS image picker work fine but in IOS I can't open camera.
STEP:
- npm i react-native-image-crop-picker --save
- react-native link react-native-image-crop-picker
- install my updated pod file: platform :ios, '8.0' target 'testApp' do pod 'RSKImageCropper' pod 'QBImagePickerController' end
import ImagePicker from 'react-native-image-crop-picker'; ImagePicker.openCamera({ cropping: true }).then(image => {}, err => {});
Platform:
- IOS simulator 6
- React native: 0.52.2
- react-native-image-crop-picker: 0.19.1
Yes I have the same issue but only with the iOS simulator (it works on android simulator, android device and iOS device). RN version 0.51.0 with react-native-crop-picker 0.19.3.
rn_path = '../node_modules/react-native' pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec" pod 'React', path: rn_path, subspecs: [ 'Core', 'RCTActionSheet', 'RCTAnimation', 'RCTGeolocation', 'RCTImage', 'RCTLinkingIOS', 'RCTNetwork', 'RCTSettings', 'RCTText', 'RCTVibration', 'RCTWebSocket' ]
for iOS check this path: project->General->Linked Frameworks and Libraries make sure you can find <libimageCropPicker.a> otherwise, click '+', and add this package
it works for me
me too
anyone have found a solution for this ? I get this error Cannot run camera on simulator