I am getting the following error when trying to take photo with flashMode attribute modified:
{ NSLocalizedDescription: 'Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x170440210 {Error Domain=NSOSStatusErrorDomain Code=-16800 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (-16800), NSLocalizedDescription=The operation could not be completed}' } } 2017-09-12 00:08:29.907053-0300 GimenesApp[1936:765074] { [Error: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x170440210 {Error Domain=NSOSStatusErrorDomain Code=-16800 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (-16800), NSLocalizedDescription=The operation could not be completed}]
Here is the piece of code that I am using:
<Camera
captureTarget={Camera.constants.CaptureTarget.disk}
ref={(cam) => {
this.camera = cam;
}}
flashMode={this.state.flashMode}>
<Button onPress={this.takePicture.bind(this)} transparent
<Icon name="ios-radio-button-off" />
</Button>
</Camera>
So, I solved this error removing two calls to setState
Here is my take photo method:
Before, I was setting the state twice in my takePicture method. I just moved the outside setState and the error is gone.
I do not know why, but now, it is working.
If anyone have an explanation to this error, please, share with us.