Crash on second invocation #426
Comments
I'm having the same problem too...! |
N.B. the problem only exists in the simulator. Works fine on device. |
same problem here: [access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data. Its fixed by adding the NSCameraUsageDescription key in Info.plist with a description of what u use the camera access for. its displayed in the popup when you request the camera access the first time But another problem: Error: Error setting property 'captureAudio' of RCTCamera with tag #342: capturing audio |
This is relating to iOS 10.0. I fixed the issue with this inside Info.plist
The string can really be anything you want, it'll display when the app launches and asks for permissions to use the camera. |
@andrerfneves it does not fix for me. The second invocation crashes. I have the the NSCameraUsageDescription key set in my .plist files. |
@ibussieres I didn't run into second invocation issues. But whenever I flipped the camera to the front camera the app crashed. I had to add the same key and string pair on the .plist file but for the Microphone native properties.
Not sure if this will fix your issue, but this is what helped me solve it. |
As this only happens in the simulator I'm guessing that there is something more that needs to be wrapped in an |
@andrerfneves it does not fix it for me, too. I've added both to the plist file: breaks at line: 988 of RCTCameraManager 2016-09-28 14:16:48.562 [info][tid:main][RCTCameraManager.m:270] Error setting property 'captureAudio' of RCTCamera with tag #342: capturing audio |
@andrerfneves thanks for the hinters, unfortunately it does not work. Besides, I am using this package only for barcode scanning so I had disabled the microphone. I think @MichaelSWE has put the finger on the type of problem that we need to surface up. I'm not too good with Objective-C either, but I'll try to look into something (yet hoping someone with better Objective-C skills will, too ;) ) |
I have the same problem. It renders fine but if I switch screens and come back it'll crash. I'm running the iPhone 7 iOS 10.0 simulator. I have only the NSCameraUsageDescription as i have autoCapture turned off (and changing the microphone setting seems to change nothing regarding this issue). For me it crashes at: https://github.com/lwansbrough/react-native-camera/blob/master/ios/RCTCameraManager.m#L988 |
I am experiencing a crash at the same place @chrisnojima have permission in info.plist for both camera and microphone... This crash appears to only occur on simulator as others have stated above |
+1 also have permissions in Info.plist |
@MichaelSWE try to put into
|
@shahen94 did that work for you? I'm still getting a crash at the same line. |
@RGBz It works for me |
Added a |
I dunno if its releated but I put camera inside a wrapping container and add a shouldComponentUpdate() { return false; } now working fine on actual android device havent tested on an actual iOS device but its worth a try. |
Not sure how and why it works, but @shahen94 fix helped me |
@kesha-antonov I've just fixed the issue. The problem really was with NSMicrophoneUsageDescription permission. Check that application has camera and microphone permissions before you render the Camera component. Also be aware that microphone permission request not work on iPhone simulators. Good luck to you. |
@uncle-T0ny Thanks! |
I did not add the microphone permission because I set video to false. I use it just for still images. No crashes here. |
Same here I have captureAudio={false} because I don't need to capture audio. Everything works fine in iOS but the Android version crashes. |
I am experiencing the same issue this issue on Android with the v0.6. |
I'm having the same problem too...! I add this key to info.plist ,was Iphone |
Steps to reproduce
Expected behaviour
I'd expect the same behavior as at the first invocation.
Actual behaviour
Crash.
At [self.session commitConfiguration] XCode reports "EXC_BAD_ACCESS"
Environment
react-native-camera
Version: lwansbrough/react-native-camera (6074ec3)
This is the version with the simulator fix
The text was updated successfully, but these errors were encountered: