【发布时间】:2019-04-05 05:18:13
【问题描述】:
当我尝试使用 react-native-image-picker 访问照片时,它返回错误“null 不是对象(正在评估 'ImagePickerManager.showImagePicker')”。
我已经尝试链接库删除节点模块,然后再次等,但没有成功。
const ImagePicker = require("react-native-image-picker");
<TouchableOpacity
onPress={() => {
const options = {
title: "Select Profile Pic",
mediaType: "photo",
takePhotoButtonTitle: "Take a Photo",
maxWidth: 256,
maxHeight: 256,
allowsEditing: true,
noData: true
}
ImagePicker.showImagePicker(options, response => {
if (response.uri){
this.setState({photo: response})
}
})
firebase.storage.ref().child(`chatImg/${this.state.photo.uri}`);
}}
style={{ flexDirection: 'row' }}
>
<View style={{ width: 15 }} />
<AutoHeightImage width={35} source=
{require('../../resource/icon_attach.png')} />
<View style={{ width: 5 }} />
</TouchableOpacity>
【问题讨论】:
标签: react-native react-native-image-picker