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

IOS ImagePicker.openCamera error

Open miyaliunian opened this issue 6 years ago • 9 comments

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

miyaliunian avatar Dec 14 '17 07:12 miyaliunian

can you please provide more details?

ivpusic avatar Dec 17 '17 23:12 ivpusic

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 :).

draperunner avatar Dec 19 '17 20:12 draperunner

+1 on this. First time getting this.

luco avatar Jan 01 '18 23:01 luco

Hi, Android work fine, IOS image picker work fine but in IOS I can't open camera.

STEP:

  1. npm i react-native-image-crop-picker --save
  2. react-native link react-native-image-crop-picker
  3. 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

condorman avatar Feb 01 '18 21:02 condorman

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.

johanleroch avatar Feb 28 '18 18:02 johanleroch

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' ]

IamMasterWayne avatar May 30 '18 15:05 IamMasterWayne

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

yongqianvip avatar Aug 07 '18 04:08 yongqianvip

me too

BengBu-YueZhang avatar Dec 10 '18 06:12 BengBu-YueZhang

anyone have found a solution for this ? I get this error Cannot run camera on simulator

1mehdifaraji avatar Sep 12 '22 15:09 1mehdifaraji