First thing, I’d say to take a peek at the docs for the APIs you’re using. You’re using the old import style, which we’ve deprecated, and the docs will show the new ones.
The “working” snack you linked is written in an older SDK, so I’m curious how you’re getting it to work? Are you running it locally on your own device, through expo-cli? If so, you must be using an older version of the Expo client app
Hi Charlie, thank you so much for looking into my question!! and pointing out the old SDK.
Yes, I run it locally on my iOS device using expo client app (2.11.1 which I think it’s latest?). On the snack browser, the expo version is set to 33.0.0 (works with 32.0.0 as well).
So I started to update the imports according the API docs as follow (hopefully I understood it right)
import { Constants, ImagePicker, Permissions } from ‘expo’; //old import
// the following three imports replaces the above old import
// import Constants from ‘expo-constants’;
// import * as ImagePicker from ‘expo-image-picker’;
// import * as Permissions from ‘expo-permissions’;
However, I am getting the following error on Snack when I change any of the above changes.
Try copy/pasting into a new snack, I’ve seen that error before and that seemed to fix it. Must have just somehow gotten into a bad state with the imports
Yeah, you could also try running it locally with expo-cli rather than through Snack. I don’t believe this is an SDK0-related problem (unless you can provide an example where the same code works on one SDK and doesn’t on another)