I'm using "react-native-image-picker": "^3.0.1"
in react native for capture image. but I got error while opening the camera in android 9.
I got error :
{"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."}
here is my code
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 {
}
},
);
Before capturing image, ask camera permission to user. In Android above marshmallow version you should ask Run Time permission as well which are called dangerous permission.
And then if permission granted then inside
if
call