I've just started using Expo and React Native to create a project for a mobile app. I've been following this guide to develop the project, and I'm building locally rather than using EAS.
I can run npx expo start
. When I do, the QR code is not parseable by my iOS device, but I'm able to visit the web app at http://localhost:8081.
However, when I try to run npx expo run:ios
or run prebuild, I get the following error:
➜ npx expo run:ios
HTTP 403 Forbidden
✖ Failed to create the native directory
You may want to delete the ./ios and/or ./android directories before trying again.
I can't seem to get any additional logs out on where the permission error is coming from, and I haven't found anyone online with the same issue. I have installed Xcode and all the necessary expo packages, and I'm logged into expo locally. I've also tethered my iOS device to my Macbook and tried running with the --device
tag, but I get the same error.
Any insight into what might be happening here? I've included my full app.json below (with the app name redacted), the rest of the project is the boilerplate created by expo.
{
"expo": {
"name": "<app_name>",
"slug": "<app_name>",
"version": "1.0.0",
"platforms": ["ios", "android", "web"],
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.<app_name>"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"web": {
"bundler": "metro",
"output": "static",
"favicon": "./assets/images/favicon.png"
},
"plugins": [
"expo-router",
[
"expo-splash-screen",
{
"image": "./assets/images/splash-icon.png",
"imageWidth": 200,
"resizeMode": "contain",
"backgroundColor": "#ffffff"
}
]
],
"experiments": {
"typedRoutes": true
}
}
}