Error: Unrecognized permission: cameraRoll (Expo 40)
Closed this issue · 5 comments
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",
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
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
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");
@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?
@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.