【发布时间】:2020-12-18 12:09:51
【问题描述】:
我正在使用 "react-native-image-picker": "^3.0.1" 在本机反应中捕获图像。但在 android 9 中打开相机时出现错误。
我有错误:
{"errorCode": "others", "errorMessage": "This library does not require Manifest.permission.CAMERA, if you add this permission in manifest then you have to obtain the same."}
这是我的代码
ImagePicker.launchCamera(
{
includeBase64: false,
mediaType: 'photo',
quality: 0.8,
},
async (response) => {
if (response.didCancel) {
console.log('User cancelled image picker');
} else if (response.error) {
console.log('ImagePicker Error: ', response.error);
} else {
}
},
);
【问题讨论】:
-
删除 ``` Manifest.permission.CAMERA `` 权限,如在清单中设置的错误消息中所述
-
我已经尝试过了,但仍然遇到这个问题
标签: android react-native android-camera react-native-image-picker