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


#1

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


#2

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


#3

Hey,

That’s it

let result = await ImagePicker.launchCameraAsync();


#4

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


#5

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


#6

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


#7

I’ve done that


#8

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"
    
  ]

#9

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


#10

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


#11

Can you share some code reproducing your issue?


closed #12

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