React-native-image-crop-picker: Undefined is not an object (evaluating ImagePicker.openCamera)

Created on 6 Aug 2018  路  7Comments  路  Source: ivpusic/react-native-image-crop-picker

Version

{
"name": "img",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"native-base": "^2.7.2",
"react": "16.4.1",
"react-native": "0.55.2",
"react-native-easy-grid": "^0.2.0",
"react-native-image-crop-picker": "^0.20.3",
"react-navigation": "^2.9.3"
},
"devDependencies": {
"babel-jest": "23.4.0",
"babel-preset-react-native": "4.0.0",
"jest": "23.4.1",
"react-test-renderer": "16.4.1"
},
"jest": {
"preset": "react-native"
}
}

Platform

  • iOS
  • Android

Expected behaviour

Actual behaviour

Undefined is not an object (evaluating ImagePicker.openCamera)

Most helpful comment

Same problem with Expo app :-1:

All 7 comments

Have anybody solved it?

+1
(I've the problem also with openPicker...)

Same problem with Expo app :-1:

Same issue.

make sure to correctly link the library to your ios and android projects.
To use with expo, you muste eject your expo project first, then link the library.

Try link manually

For manual solution, add the following on your MainApplication.java
import com.reactnative.ivpusic.imagepicker.PickerPackage;

@Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
            new PickerPackage(), // <== add this
            ....

I got rid of this by adding folder react-native-image-crop-picker inside node_modules
and run
cd ios
pod install

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhangjunhou picture zhangjunhou  路  3Comments

fmcruz picture fmcruz  路  3Comments

leelandclay picture leelandclay  路  3Comments

pavsidhu picture pavsidhu  路  3Comments

habovh picture habovh  路  3Comments