ImagePicker not working in Android / Stand alone app


#1

Hi. The ImagePicker (nor the CameraRoll) is not working in my Android stand alone app. It worked while in the Expo client.

It seems that the user by default does not have the Storage permission allowed, nor does the prompt seem to be firing at the time that I call ImagePicker.launchImageLibraryAsync. If I go to Settings > Apps > Permissions and toggle Storage, the Image Picker works.

To be clear, my app.json also has the permissions “WRITE_EXTERNAL_STORAGE”, “READ_EXTERNAL_STORAGE”, “CAMERA”, and “READ_INTERNAL_STORAGE”

Any help would be much appreciated!


ImagePicker launchImageLibraryAsync not working in android standalone build
#2

SOLVED… use permissions android.permissions.WRITE_EXTERNAL_STORAGE, …INTERNAL_STORAGE, etc

Must have android.permissions. in the app.json


#3

I’m having the same problem and adding the extra android.permissions. did not help

I got this in my app.json

"android": {
      "package": "br.com.miredefamilia",
      "versionCode": 3, 
      "permissions": [
        "android.permissions.CAMERA",
        "android.permissions.READ_INTERNAL_STORAGE",
        "android.permissions.READ_EXTERNAL_STORAGE"
      ]
    }

but no luck!

the code I’m using to get the images is:

        const image = await ImagePicker.launchCameraAsync({
            allowsEditing: true,
            aspect: [3, 5],
        });

        if (!image.cancelled)
            this.appendImageToRoll(image);

and

        let image = await ImagePicker.launchImageLibraryAsync({
            allowsEditing: true,
            aspect: [3, 5],
        });

        if (!image.cancelled)
            this.appendImageToRoll(image);
    }

and it doesn’t work.

any idea of what this could be?


#4

Currently issue opened.

On standalone android the ImagePicker doesn’t do much, on Expo app