I am trying to add React native vision camera library with expo, I am currently using EAS for builds. I added react-native-vision-camera to package,json and I am requesting the required permissions from the user using the same library… The build works fine on android after running “npx expo prebuild” and creating a development build build however It isn’t working for IOS and it displays the following message after creating the build and trying to run it locally:
“No permission handler detected.
• Check that you added at least one permission handler in your package.json reactNativePermissionsIOS config.
• Uninstall this app, reinstall your Pods, delete your Xcode DerivedData folder and rebuild it.”
I tried updating info.plist file to add all permissions and rebuilt the project but I am still getting same error message
please let me know the cause of this error as well as what steps can be taken to solve it
You do not need to run npx expo prebuild. If you do it effectively switches you to the bare workflow.
I know the react-native-vision-camera docs tell you to run it, but it is not necessary for you to run it. If you do not run it then it will be run for you automatically by the build servers.
If you have not made any changes to the android and ios directories, I suggest you delete them to switch back to the managed workflow. Then try building again and see if that sorts out the problem.
building with managed flow without expo pre-build worked for staging version and, however I am receiving the following error (“no permissions handler detected”) for development environment:
I assume you have something like this in your plugins section in app.json?
"plugins": [
[
"react-native-vision-camera",
{
"cameraPermissionText": "$(PRODUCT_NAME) needs access to your Camera.",
// optionally, if you want to record audio:
"enableMicrophonePermission": true,
"microphonePermissionText": "$(PRODUCT_NAME) needs access to your Microphone."
}
]
]
I’ve only had a brief look, but it might conflict with the way Expo and its config plugins do things. You might be able to get it to work by calling npx react-native setup-ios-permissions in a build hook or something like that.
Otherwise, you will need to run npx expo prebuild and then continue with the Bare workflow. Or else, replace react-native-permissions with something else.