undefined is not an object(evaluating 'ImagePickerManager.showImagePicker')

匆匆过客 提交于 2019-12-12 10:47:19

问题


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 your build.gradle file


来源:https://stackoverflow.com/questions/40018381/undefined-is-not-an-objectevaluating-imagepickermanager-showimagepicker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!