MOuad AB
MOuad AB

Reputation: 1

react-native-camera crashed my application

When I add dependencies for QrCode Scanner(react-native-camera) and running project, my app is crashing and is not working.

enter image description here

Upvotes: 0

Views: 3289

Answers (2)

Tszfung Chan
Tszfung Chan

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

Devesh Agnihotri
Devesh Agnihotri

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

Related Questions