The react native app crashes while i am choosing multiple(> 8 images) images at the same time. It will happen while processing images after selecting that.
do you have some time to take a look into this?
i have a same problem, after select multi image, it will take a long delay to process, sometime it may cause the app shutdown.
I had the same problem, and it was related to react-native-splash-screen package.
MainActivity.java file had a SplashScreen.show(this); and when I select image from the picker it was causing the android app to close. When i removed it everything started to work again.
+1
for me choosing about 16mb (7 photos) on Nexus 6 (3GB ram) will crash app
on ios it works fine
Fixed it!
when picking multiple, remember not to set this line includeBase64: true in openPicker
this will cause outofMemory issue on Android
if you need base64 data, use sth like FileSystem.readFile(image.path, 'base64') in .then()
Anyway hope this will be fixed soon
@pisacode when you say "When I removed [react-native-splash-screen]" were you removing the entire package, or just the SplashScreen.show(this) line in MainActivity.java?
I'm experiencing this issue and am also using react-native-splash-screen, and you're the only person I've seen in all of the 5 or so open issues referencing the app restarting after taking a photo who has reference the splash screen. Any help welcome, this bug is really starting to frustrate me!
I fixed this by asking the permissions on Android and iOS (using react-native-permissions lib):
useEffect(() => {
async function askPermissions() {
if (Platform.OS === 'android') {
await Permissions.requestMultiple([
'android.permission.CAMERA',
'android.permission.WRITE_EXTERNAL_STORAGE',
]);
}
if (Platform.OS === 'ios') {
await Permissions.requestMultiple(['ios.permission.CAMERA', 'ios.permission.PHOTO_LIBRARY']);
}
}
askPermissions();
}, []);
@krewllobster @pisacode i'm also facing the same issue. Any fix?
Most helpful comment
Fixed it!
when picking multiple, remember not to set this line
includeBase64: truein openPickerthis will cause outofMemory issue on Android
if you need base64 data, use sth like
FileSystem.readFile(image.path, 'base64')in.then()Anyway hope this will be fixed soon