当我尝试使用 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>