Android app crash when accessing CodePush
We have an issue on Android where, after uploading a photo via react-native-image-picker, we'd get a crash: E/Vold(3586): Failed to find mounted volume for /storage/extSdCard/Android/data/com.zeemee.zeemee_android.Staging/cache/
We noticed right before the crash, the app was attempting a codepush operation. We commented out codepush, and the crashes no longer exist.
What is super crazy about it is that, after the first crash, you can never launch the app again - it'd crash in exactly the same way.
07-28 19:42:30.012: D/ReactNative(27166): [CodePush] Loading JS bundle from "/data/data/com.zeemee.zeemee_android.Staging/files/CodePush/<bunch of characters>/CodePush/index.android.bundle"
07-28 19:42:30.017: E/Vold(3586): Failed to find mounted volume for /storage/extSdCard/Android/data/com.zeemee.zeemee_android.Staging/cache/
07-28 19:42:30.017: W/ContextImpl(27166): Failed to ensure directory: /storage/extSdCard/Android/data/com.zeemee.zeemee_android.Staging/cache
07-28 19:42:30.432: E/Vold(3586): Failed to find mounted volume for /storage/extSdCard/Android/data/com.zeemee.zeemee_android.Staging/cache/
07-28 19:42:30.437: W/ContextImpl(27166): Failed to ensure directory: /storage/extSdCard/Android/data/com.zeemee.zeemee_android.Staging/cache
/storage/extSdCard is empty on the device.
Thanks!
Hi @huitsing, do you have a stack trace? The ones you pasted looks like just debug logs.
This only happens on a release build unfortunately, so we don't get much context.
Could you share a code snippet on how you are using the image picker (options, etc)? I'm trying to set up a repro.
let opts = {
title: 'Choose a Photo', // specify null or empty string to remove the title
cancelButtonTitle: 'Cancel',
takePhotoButtonTitle: 'Take Photo', // specify null or empty string to remove this button
// specify null or empty string to remove this button
chooseFromLibraryButtonTitle: 'Choose Photo from Library',
maxHeight: 900,
maxWidth: 900,
quality: 1,
cameraType: 'back', // 'front' or 'back'
mediaType: 'photo', // 'photo' or 'video'
allowsEditing: true, // Built in functionality to resize/reposition the image after selection
// photos only - disables the base64 `data` field from being generated
// (greatly improves performance on large photos)
noData: false,
storageOptions: {
skipBackup: true,
path: 'uploads',
},
};
ImagePickerManager.showImagePicker(opts, (response) => {
if (response.didCancel) {
// handle user cancel case.
} else if (response.error) {
// handle error case.
} else if (response.customButton) {
// Handle custom button response.
} else {
// Handle photo upload.
}
});
I can't get a repro to work from just launching the image picker after a codepush update is installed.
You said the crash only happens after the photo is uploaded? What exactly happens in the upload step, it just sends the image data to a server? What is triggering the read to the SD card?
Could you have accidentally CodePush-ed an update to production after adding a new react native plugin, which isn't bundled in the binary of your production apps, thereby causing a crash since the JS code that was pushed out isn't compatible to the binary?
@huitsing, did you still need help with this issue?
Hi @silhouettes - we ended up shipping without CodePush on Android for this release to avoid the crashing, but it's in our near-term backlog to reevaluate. Hopefully we can give you a much cleaner, more direct answer soon on this.
Thanks, looking forward to getting to the bottom of this!
Hi @huitsing, just a friendly ping! Were you able to repro the crash?
Hi @silhouettes - thanks for the ping! We have just finished testing this (within the past hour) and it's working great! No crashes.
We can't really prove it, but there is a descent chance that we were in a bad state on our deployed JS bundle's compatibility with the underlying native code in our dev environment when we were experiencing problems. From your end, I'd assume that this is a non-issue. I will open a new issue if we run into any other problems.
Thanks @huitsing, I'm glad it's working now :)