natysoz / expo-images-picker

Multiple Asset Photos Videos selecting package for Expo SDK
MIT License
95 stars 35 forks source link

Error: Unrecognized permission: cameraRoll (Expo 40) #12

Closed daniel closed 3 years ago

daniel commented 3 years ago

I upgraded the Snack to Expo 40: https://snack.expo.io/@daniel-overstellar/expo-images-picker-example---expo-40

It works fine there, but if I download the files and run the code locally I get this error:

[Unhandled promise rejection: Error: Unrecognized permission: cameraRoll, please install and link the package expo-media-library, see more at https://github.com/expo/expo/tree/master/packages/expo-media-library]

The package.json file includes "expo-permissions": "~10.0.0",

natemartins commented 3 years ago

CameraRoll permission is deprecated. If you included it in your permissions in app.json, remove it. Also install expo-media-library package.

You should be good to go

daniel commented 3 years ago

It's not included in app.json and I have installed expo-media-library.

I have now published the code here: https://github.com/daniel/expo-images-picker-example

Ozzi48 commented 3 years ago

For another guys who using Expo < 40 version, you can just change code in node_modules/expo-images-picker/src/AssetsSelector.tsx line 142-148 with: const { status: CAMERA }: any = await Permissions.askAsync("camera"); and const { status: CAMERA_ROLL }: any = await Permissions.askAsync("cameraRoll");

natysoz commented 3 years ago

@daniel are u using "expo-images-picker": "1.1.0" ? can u please upgrade to latest 1.3.0 and see if all works fine?

daniel commented 3 years ago

@natysoz Thanks, that worked! I didn't notice I was using the old version, because I just copied the demo snack that is linked to from the repo here and assumed it was using the latest version. So the problem here is that the demo snack hasn't been updated. I'll create a new issue for that.