react-native-vision-camera: ๐ When taking a photo the capture fails with error `-11800: The operation could not be completed`
Whatโs happening?
Please watch the video below.
========================================================================================
The error only occurs under completely specific conditions.
In my opinion, this condition is when using IOS17 or higher on iPhone 14
The error did not occur when using IOS16 on iPhone 14.
I canโt confirm that itโs a bug in IOS17. Because when using IOS17 on other devices such as SE, 12, etc., the bug does not occur.
I want to know what the problem is.
The build took place in xcode14.2.
Reproduceable Code
const device = useCameraDevice('back');
try {
if (tempPath === '') {
setIsActive(false);
const photo =
Platform.OS === 'ios'
? await cameraRef.current.takePhoto({
flash: 'off',
})
: await cameraRef.current.takeSnapshot({
quality: 80,
flash: 'off',
});
let rotatedUri = photo.path;
await foodLensProcess(rotatedUri);
} else {
setTempPath('');
setFoodInfo(null);
setUploadPath('');
setIsActive(true);
}
} catch (err) {
alert(err);
console.log('takePhoto catch :', err);
}
<Camera
ref={cameraRef}
style={StyleSheet.absoluteFill}
device={device}
isActive={isActive}
photo={true}
/>
Relevant log output
Error Domain=AVFoundationErrorDomain Code=-11800 The operation could not be completed UserInfo={NSUnderlyingError=0x28006b360 { Error Domain=NSOSStatusErrorDomain Code=-16800 "(null)"}, NSLocalizedFailureReason=Anunknown error occurred (-16800), AVErrorRecordingFailureDomainKey=4, NSLocalizedDescription=The operation could not be completed}
Camera Device
-
Device
iPhone 14 Pro(IOS 17.0.2, 17.0.3)
VisionCamera Version
3.3.1
Can you reproduce this issue in the VisionCamera Example app?
Yes, I can reproduce the same issue in the Example app here
Additional information
- I am using Expo
- I have enabled Frame Processors (react-native-worklets-core)
- I have read the Troubleshooting Guide
- I agree to follow this projectโs Code of Conduct
- I searched for similar issues in this repository and found none.
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Comments: 18 (6 by maintainers)
I have this problem too, iOS 17.1.1 in a native app (swiftui). In my case it works sometimes. So it looks like some kind of timing error. I seem to solve the problem by setting photoSettings.photoQualityPrioritization = .speed // instead of .quality
Not sure that setting is accessible here, but just trying to solve the same problem sort of.