mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.43k stars 1.09k forks source link

🐛 AVFoundationError -11819 #3245

Open tgreco opened 1 day ago

tgreco commented 1 day ago

What's happening?

When taking a photo randomly I get this error thrown.

image

image

Reproduceable Code

const takePhotoResult = await cameraRef.current.takePhoto({
          flash: 'off',
          enableAutoRedEyeReduction: false,
          enableAutoDistortionCorrection: false,
});

 <ReanimatedCamera
                ref={cameraRef}
                style={styles.fill}
                device={device}
                format={format}
                fps={FRAMES_PER_SEC}
                videoHdr={format?.supportsVideoHdr}
                photoHdr={format?.supportsPhotoHdr}
                // lowLightBoost={device.supportsLowLightBoost && isNightMode}
                isActive={isActive}
                onInitialized={onInitialized}
                onError={onError}
                enableZoomGesture={false}
                animatedProps={cameraAnimatedProps}
                photo
                video={mediaType === MediaType.video}
                audio={hasMicrophonePermission && mediaType === MediaType.video}
                enableLocation
                photoQualityBalance="speed"
              />

Relevant log output

[capture/unknown: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x302afbf30 {Error Domain=NSOSStatusErrorDomain Code=-16802 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (-16802), AVErrorRecordingFailureDomainKey=4, NSLocalizedDescription=The operation could not be completed}]

If I try to print the error description I get this nonsense:

description of error:
error: type for self cannot be reconstructed: type for typename "$s12VisionCamera7PromiseCD" was not found
error: Couldn't realize Swift AST type of self. Hint: using `v` to directly inspect variables and fields may still work.

Camera Device

{
  "position": "back",
  "maxZoom": 123.75,
  "hasTorch": true,
  "formats": [],
  "supportsLowLightBoost": false,
  "maxExposure": 8,
  "sensorOrientation": "portrait",
  "isMultiCam": true,
  "minZoom": 1,
  "minFocusDistance": 2,
  "id": "com.apple.avfoundation.avcapturedevice.built-in_video:7",
  "hasFlash": true,
  "name": "Back Triple Camera",
  "minExposure": -8,
  "hardwareLevel": "full",
  "supportsFocus": true,
  "supportsRawCapture": false,
  "neutralZoom": 2,
  "physicalDevices": [
    "ultra-wide-angle-camera",
    "wide-angle-camera",
    "telephoto-camera"
  ]
}

Device

iPhone 16 - ios 18.1

VisionCamera Version

4.5.3

Can you reproduce this issue in the VisionCamera Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

maintenance-hans[bot] commented 1 day ago

Guten Tag, Hans here 🍻

Thanks for reporting ze issue! It looks like you’ve already provided some helpful information, but we do need a bit more to help you effectively.

Could you please confirm if you are able to reproduce zis issue in ze VisionCamera Example app? It’s important to test zis, as it can help narrow down if it’s an issue with your implementation or ze library itself.

Also, please make sure to provide any relevant logs from Xcode, as they can be very useful in diagnosing ze problem. You can find ze logs in Xcode's Output window while running your app.

If you have not tried these steps yet, I recommend doing so, and if ze problem persists, we can take a deeper look together.

Danke!

Note: If you think I made a mistake, please ping @mrousavy to take a look.