问题
I am trying to use react-native-image-picker, but stuck here, it always shows the error as on the below photo:
undefined is not an object(evaluating 'ImagePickerManager.showImagePicker')
Is there anyone who had this problem?
回答1:
I had met it too. After a few hours, I find a solution to it.
Install $npm install react-native-image-picker@latest --save Automatic Installation React Native >= 0.29 $react-native link React Native < 0.29 $rnpm link
https://github.com/marcshilling/react-native-image-picker/blob/master/README.md This document is not up-to-date.
Using the above command, you can get the latest one. Then you can follow the README.md to use it. That is my way to solve it.
Good Luck!
回答2:
This message is basically saying that the native side of your app is not fully linked with the library.
Be sure to add:
- iOS :
libRNImagePicker.a
to your app (XCode => Build phases => Link Binary with Libraries => +, then select the right file
) - Android :
compile project(':react-native-image-picker')
to yourbuild.gradle
file
来源:https://stackoverflow.com/questions/40018381/undefined-is-not-an-objectevaluating-imagepickermanager-showimagepicker