Open ram3919 opened 4 years ago
add permission:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
change buildToolsVersion: android { compileSdkVersion 28 buildToolsVersion "28.0.3" }
i have already tried with this.but this is not a solution. i'm using react native version 0.61
react-native-customized-image-picker/pickerExample, Can it be normal? or check whether your app have camera permission in system settings
Hi, I got the solution, please check your Logcat in android studio. if you are getting this error (Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=30850, uid=10299 requires android.permission.WRITE_EXTERNAL_STORAGE)
then just request for the permission for WRITE_EXTERNAL_STORAGE before opening camera.
example: async handleCamera() { try { const results = await PermissionsAndroid.requestMultiple([ PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE, PermissionsAndroid.PERMISSIONS.CAMERA ]);
if (
results[PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE] ===
"granted" &&
results[PermissionsAndroid.PERMISSIONS.CAMERA] === "granted"
) {
ImagePicker.openCamera(CAMERA_PROPS).then(fileObj => {
});
} else {
console.log("Camera permission denied");
}
} catch (err) {
console.warn(err);
}
}
I found out that this is happening when using react-native-fast-image with it, check if this is happening with you also, i don't have a solution to make them work together thou
most time app get crashed . no proper solution .
most time app get crashed . no proper solution .
Same issue here. Any help please. Thanks
can do some validation
Is the picture big
Whether the image format is correct and whether the file suffix has been modified
Is it an empty file
Whether it is a compressed file. If the compressed parameter has been used, a compressed file will be generated. The name is:*_compressed,In this case, it can be used ImagePicker.clean () to clear up
This package crash on Android 11 , i resolve this problem by : Adding imageLoader: 'UNIVERSAL' to openPicker params
when I try to open camera,in openPicker my app is getting crash without log. Please provide me any solution.
ImagePicker.openPicker({ multiple: true, isCamera:true, maxSize:5, multipleShot:true }).then(image => { resolve(image) })