when I try to use image picker in the expo client . I get [Unhandled promise rejection: Error: User rejected permissions]

I am porting my IOS app to android.

Everything works fine on IOS but on android when I try to take an image using (Imagepicker.launchCameraAsync) I get

[Unhandled promise rejection: Error: User rejected permissions]

  • node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:123:42 in createErrorFromErrorData
  • node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:80:57 in
  • … 5 more stack frames from framework internals

I’ve tried all the suggestions I’ve seen on GitHub and the forum.

Here are my permissions:

“permissions”: [
“CAMERA”,
“READ_INTERNAL_STORAGE”,
“WRITE_INTERNAL_STORAGE”,
“READ_EXTERNAL_STORAGE”,
“WRITE_EXTERNAL_STORAGE”
]

I’m not sure what else to do

Hi there! Would you mind posting some simple code that reproduces this issue so we can see what’s wrong?

Hey,

That’s it

let result = await ImagePicker.launchCameraAsync();

Our docs state here that launchCameraAsync “Requires Permissions.CAMERA along with Permissions.CAMERA_ROLL”. You have only CAMERA permissions

Thank you, I just added that and it still isn’t working.

Could you post a snack here with a full example? It would be helpful to see exactly what you’re doing.

I’ve done that

Hi, I now have this problem on IOS, when I try to use imagepicker.laucnhImageLibraryasync.

I didn’t have this problem before. I am using sdk 24. Is this from the expo client?

I have added camera roll to my permissions.

“permissions”: [

    "CAMERA_ROLL"
    
  ]
1 Like

You also have to use Permissions module and invoke Permissions.askAsync

1 Like

I’m doing this now but i keep getting undefined as my response

Can you share some code reproducing your issue?

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.