moaazsidat / react-native-qrcode-scanner

A QR code scanner component for React Native.
MIT License
2.04k stars 516 forks source link

Scanner crashes the app (libsystem_kernel.dylib__abort_with_payload:) #162

Open ghost opened 5 years ago

ghost commented 5 years ago

What's happening?

When I go to the QR Scanner application, the scanner crashes the application and the following error comes up in my Xcode.

This happens AFTER I give it permission to use the camera. ( I have a NSCameraUsageDescription)

Build details?

"react": "16.6.3",
"react-native": "0.57.8",
"react-native-camera": "^1.8.0",
"react-native-qrcode-scanner": "^1.1.2",
ghost commented 5 years ago

I fixed this by adding the following. I do not plan on using microphone or camera roll but it had to be there or it crashed.

<!-- Include this only if you are planning to use the camera roll -->
<key>NSPhotoLibraryUsageDescription</key>
<string>Your message to user when the photo library is accessed for the first time</string>

<!-- Include this only if you are planning to use the microphone for video recording -->
<key>NSMicrophoneUsageDescription</key>
<string>Your message to user when the microsphone is accessed for the first time</string>
fsalata commented 5 years ago

I've just rolled back react-native-camera to version 1.6.3. I don't want to ask for microphone permission to scan a QRCode...

jinchung commented 5 years ago

Actually it looks like for the full fix, you need to add the NSMicrophoneUsageDescription key as mentioned above and then set the cameraProps={{captureAudio: false}} as noted in https://github.com/moaazsidat/react-native-qrcode-scanner/issues/160

moaazsidat commented 5 years ago

should be fixed when this is released: https://github.com/moaazsidat/react-native-qrcode-scanner/pull/168