Permissions.AskAsync(CAMERA_ROLL) is granted yet missing camera roll permission is returned

try opening that exact snack that I linked to in your simulator and let me know if it works. you can do this by signing into your account in the expo app in the simulator, and then pressing ‘run on device’ in snack and signing into your account there

@notbrent it is now working after upgrading to expo 27. Thank you so much.

@notbrent I have followed your instructions and still no luck. I am running expo 27. I’ve copied your snack exactly and implemented into my code but still says “missing camera roll permissions”. The status comes back as granted but does not open up the image picker.

When looking at your snack, it asked for permissions which I allowed and then my app also asked after opening your snack, but still no camera roll opening up.

My code is pasted below, triggered by a button press.

savePhoto = async () => {
    const { status } = await Permissions.askAsync(Permissions.CAMERA_ROLL)

    if (status === 'granted') {
      ImagePicker.launchImageLibraryAsync({
        allowsEditing: true,
        aspect: [1, 1]
      }).then(newPostImage => {
        if (!newPostImage.cancelled) {
          this.setState({ newPostImage, createPostModalVisible: true })
        }
      })
      .catch(err => console.log(err))
    }
  }

Please let me know if you have any ideas - or how to revert back to a previous working version as I also have a presentation soon. Thanks.

did the snack I shared work for you though? before copying the code into your app. if so, can you repro this on an empty new project?

Hello @seanking1, I had to carefully review the upgrade guide: Expo SDK v27.0.0 is now available | by Ben Roth | Exposition to make it work. I missed a few settings initially… Have you gone through all the steps?

1 Like

@mazerab Thank you so much. I had made all the changes in my code, but missed a few steps as well.

@notbrent thanks for your help - but got it fixed now after properly following the upgrade guide.

worked like a charm!
Thanks a lot :slight_smile:

yes @notbrent snack is working perfectly fine when standalone in snack, however when i copy and pasted the code from the snack to my project, unfortunately the ‘Missing camera or camera roll permission’ is still there.

@mazerab would you mind sharing whats the “a few settings” in the upgrade guide you talking about?

Thanks @notbrent!
Code working fine.
:man_technologist:t5:

Unfortunately, @notbrent solution does not work with SDK 25. :cry:

@nmacambira You have to upgrade your SDK to 26.

Check out this blog post: Upgrade to Expo SDK v26.0.0

:sweat_smile:

can you share your project?

if you install expo 25.0.1 (npm install expo@25.0.1 --save) this will fix the issue on sdk25, provided that you also request permissions as demonstrated in the snack above (Permissions with ImagePicker - Snack)

1 Like

The ones that fixed if for me was the section near the bottom. Below is from the article.

Here’s how to upgrade your app to Expo SDK 27.0.0 from 26.0.0:

Close XDE or your exp CLI server
In app.json, change sdkVersion to "27.0.0"
In package.json, change these dependencies:
- react-native to "https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz"
- expo to "^27.0.0"
- react to ("16.3.1" — this exact version) 
- react-navigation to "1.5.11" (if you use it, and be sure to peruse the release notes)
- jest-expo to "^27.0.0" (if you use it)
- sentry-expo did not change from "~1.7.0" (if you use it)
Delete your project’s node_modules directory and run npm install again (or use Yarn, we love Yarn)
Reopen your project in XDE and press “Restart” to clear the packager cache, or run exp start -c if you use use exp.
Update the Expo app on your phones from the App Store / Google Play. XDE and exp will automatically update your apps in simulators.
If you use ExpoKit: follow the special upgrade instructions below to get bundled assets when updating an existing ExpoKit project to to SDK 27.
Make sure to check the breaking changes section of this post!
1 Like

Thanks @notbrent!

@nmacambira I upgraded to SDK 27 to fix my issue.

When we apply the “breaking changes” instructions from 27.0.0 to 25.0.1, we get a mostly working app, but now we periodically get non-native permission modals. Has anyone else experienced this?

The modal says, Experience needs permissions. Sometimes the message says something “App needs permissions for (null),” followed by “You’ve already grated permission to another Expo experience. Allow App to use it also?”

I don’t recall seeing this modal in our production app before, I believe this is a regression.

I’m deploying a patch to our iOS standalone app builders which should eliminate the “Experience needs permissions” regression. It will likely take a couple hours before this gets rolled all the way to production.

1 Like

The fix is out on prod. Please try rebuilding with exp build:ios and let us know if the issue with the non-system “experience needs permissions” dialog is resolved in the new binary.

If you rebuild and find that you’re still having issues, we may need to wait for further input from @aalices .

Upgrading to sdk 27 didn’t fix the issue for me on iOS. Here is a snack repro: Missing camera roll permission - Snack