我按照react-native-image-picker中的自述文件进行了手动和自动链接(分别尝试)。
当我使用从终端启动模拟器时react-native run-ios
出现错误。从 Xcode 启动时它工作正常,我可以访问 CameraRoll 选择器没有问题。
以下是我正在使用的版本:
"react-native": "0.43.3",
"react-native-image-picker": "^0.26.3",
我在这里看到了一个类似的线程stackoverflow,看来我不是唯一一个遇到这个问题的人。
感谢您的帮助。
完整的错误:
undefined is not an object (evaluating 'ImagePickerManager.showImagePicker')
showImagePicker
index.js:28:30
selectPhotoTapped
CamPick.js:31:32
touchableHandlePress
TouchableOpacity.js:126:45
_performSideEffectsForTransition
Touchable.js:746:34
_receiveSignal
Touchable.js:664:44
touchableHandleResponderRelease
Touchable.js:433:24
invokeGuardedCallback
ReactErrorUtils.js:30:9
executeDispatch
EventPluginUtils.js:99:42
executeDispatchesInOrder
EventPluginUtils.js:127:20
executeDispatchesAndRelease
EventPluginHub.js:37:46
forEachAccumulated
forEachAccumulated.js:30:16
processEventQueue
EventPluginHub.js:227:8
runEventQueueInBatch
ReactEventEmitterMixin.js:18:35
handleTopLevel
ReactEventEmitterMixin.js:38:25
<unknown>
ReactNativeEventEmitter.js:113:8
perform
Transaction.js:149:24
batchedUpdatesWithControlledComponents
ReactGenericBatching.js:51:26
_receiveRootNodeIDEvent
ReactNativeEventEmitter.js:111:40
receiveTouches
ReactNativeEventEmitter.js:200:8
__callFunction
MessageQueue.js:244:47
<unknown>
MessageQueue.js:108:26
guard
MessageQueue.js:46:4
callFunctionReturnFlushedQueue
MessageQueue.js:107:10