我跟着自述從react-native-image-picker與手動和自動連接(分別審判兩者)。陣營本機圖像選取器:「未定義不是(評價‘ImagePickerManager.showImagePicker’)的對象」
當我使用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
你這樣做:'VAR ImagePickerManager =需要(」反應,原生影像選擇器');'? – Cherniv
我使用了'react-native-image-picker'這個例子''import import ImagePicker;'''我剛剛試過了你的版本,並且得到了同樣的錯誤 –
好吧,把它改成:'import ImagePickerManager from 'react-native-image-picker';' – Cherniv