Reputation: 1
When I add dependencies for QrCode Scanner(react-native-camera) and running project, my app is crashing and is not working.
Upvotes: 0
Views: 3289
Reputation: 1
I face the same situation when I ejected my app from expo and tries to use react-native-camera.
If you are using both expo-camera and react-native-camera, then the app will crash when the camera is open, just use one of the libraries will be fine, for me, I just uninstall both cameras, then re-install react-native-camera, and the camera works!
Upvotes: 0
Reputation: 121
Add permissions to your app android/app/src/main/AndroidManifest.xml file:
<uses-permission android:name="android.permission.CAMERA" />
Insert the following lines in android/app/build.gradle:
android {
...
defaultConfig {
...
missingDimensionStrategy 'react-native-camera', 'general'
}
}
for reference check this [1]: https://github.com/react-native-community/react-native-camera/blob/master/docs/installation.md#requirements
Upvotes: 2