React-native-image-crop-picker: App crashed after choosing photos

Created on 23 Nov 2017  路  8Comments  路  Source: ivpusic/react-native-image-crop-picker

Version

  • react-native-image-crop-picker v^0.18.1
  • react-native v0.49.3

Platform

  • Android

Actual behaviour

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.

Steps to reproduce

  1. Select multiple images at the same time ( > 8)

Most helpful comment

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

All 8 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

victorwpbastos picture victorwpbastos  路  3Comments

equesteo picture equesteo  路  3Comments

aterribili picture aterribili  路  3Comments

Martian2Lee picture Martian2Lee  路  3Comments

xuchao321 picture xuchao321  路  3Comments