react-native-image-crop-picker: App crashes on Android (openPicker and openCamera)
Version
Tell us which versions you are using:
- react-native-image-crop-picker v0.19.2
- react-native v0.53.0
Platform
Tell us to which platform this issue is related
- Android 8.0
Expected behaviour
openCamera: Open camera openPicker: Select a picture in the gallery
Actual behaviour
openCamera: Crashes while opening (E_FAILED_TO_OPEN_CAMERA
)
openPicker: Crashes after selecting a picture (no logs, not even entering in a catch
)
Permissions are all given.
Steps to reproduce
openCamera:
ImagePicker.openCamera({width: 1000, height: 1000, cropping: true})
openPicker:
ImagePicker.openPicker({width: 1000, height: 1000, cropping: true})
then select a picture
Attachments
openCamera:
Error: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference
I was just upgrading my packages, and it also happens that my phone was upgraded from Android 7.x to 8.0, so I’m not sure whether it’s because of the new version of Android or React / React Native. Seems to be working fine on iOS though.
EDIT: Just tested on Android 7.1.1, I get the exact same behaviour.
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 22 (1 by maintainers)
I also came into this issue. For me, change to ‘compileSdkVersion 27’ and use ‘com.android.support:appcompat-v7:27.0.2’ can fix this issue.
@OzoTek I have added this and still have the same problem, I’ll double check on later if I don’t have any bugs in the code… I would switch to this one too if I wouldn’t need to crop the image.
Hi Guys, tried this out today. A small typo in the second add from above should read; android/app/src/main/res/xml/provider_paths.xml
However, sadly this fix has NOT worked for me. Same behavior as before. Select an image for cropping from the gllery or where ever and program crashes SEVERELY - no error message, nothing.
Cheers, Markus
It definitely seems to be an Android 8.0 problem. I have the same code 0.19.1 running fine on various Android 7.1.1 emulators. As soon as I try it on Android 8.0, just as OzoTek mentioned, it crashes hard when selecting a photo from the gallery. I’ve been testing on Android 7 and just today tried it on 8. Using RN 0.51 BTW.