React-native-image-crop-picker: null is not an object (evaluating '_reactNativeImageCropPicker.default.openCamera')

Created on 27 Sep 2019  路  8Comments  路  Source: ivpusic/react-native-image-crop-picker

Version

Tell us which versions you are using:

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

Platform

Tell us to which platform this issue is related

  • iOS
  • Android

Expected behaviour

Actual behaviour

Steps to reproduce

1.

2.

3.

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

Most helpful comment

You will need to go to your podfile (ios/Podfile) and add the following line in your dependencies:

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

After adding this line, save it and run pod install or bundle exec pod install if you use Bundler and rebuild the app. It should work now.

It seems that one of the last changes to the README actually removed this crucial step:
https://github.com/ivpusic/react-native-image-crop-picker/commit/938c74dd42b06d739e3e2be8effb8fd94909b281#diff-04c6e90faac2675aa89e2176d2eec7d8

All 8 comments

Same here. Any solutions for this ?

You will need to go to your podfile (ios/Podfile) and add the following line in your dependencies:

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

After adding this line, save it and run pod install or bundle exec pod install if you use Bundler and rebuild the app. It should work now.

It seems that one of the last changes to the README actually removed this crucial step:
https://github.com/ivpusic/react-native-image-crop-picker/commit/938c74dd42b06d739e3e2be8effb8fd94909b281#diff-04c6e90faac2675aa89e2176d2eec7d8

@ChristopheVandePoel what about running on android device / emulator??

I did not have any problems installing it in Android. With RN 60+ the autolinking should at least install it automatically and the post-install steps in the docs seem to be pretty much correct.

@ChristopheVandePoel nope, autolinking does not work for me for Android. A lot of other packages don't manage well autolinking on Android either. Had to run react-native link --platforms android react-native-image-crop-picker in order for it to work. On iOS though, the autolinking works smoothly.

As noted by @bockc the solution was to use the link command. I installed react-native-image-picker-crop before ejecting from expo, maybe that was what caused the error for me.

For information, we don't use expo at all, so I don't think it has anything to do with the linking issue. I tried to unlink the package for android and rerun a simple yarn for it to trigger the post install scripts which are supposed to autolink the package, but it didn't change the outcome, it still wasn't linked properly.

cannot reproduce this issue. please make sure that you followed installation steps from readme

Was this page helpful?
0 / 5 - 0 ratings