Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 AVFoundationError -11819 #3245

Open
3 of 5 tasks
tgreco opened this issue Oct 15, 2024 · 3 comments
Open
3 of 5 tasks

🐛 AVFoundationError -11819 #3245

tgreco opened this issue Oct 15, 2024 · 3 comments
Labels
🐛 bug Something isn't working

Comments

@tgreco
Copy link

tgreco commented Oct 15, 2024

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

@tgreco tgreco added the 🐛 bug Something isn't working label Oct 15, 2024
Copy link

maintenance-hans bot commented Oct 15, 2024

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.

@tgreco tgreco changed the title 🐛 iOS 18 - Taking photo quickly causes error to be thrown 🐛 iOS 18 - Taking photo quickly causes error to be thrown AVFoundationError -11819 Oct 15, 2024
@tgreco tgreco changed the title 🐛 iOS 18 - Taking photo quickly causes error to be thrown AVFoundationError -11819 AVFoundationError -11819 Oct 15, 2024
@maintenance-hans maintenance-hans bot changed the title AVFoundationError -11819 🐛 AVFoundationError -11819 Oct 15, 2024
@iliapnmrv
Copy link

iliapnmrv commented Nov 5, 2024

Hey! I have the same issue in Sentry (400+ times, 150+ users), cannot reproduce in dev though. I'm using code scanner

const device = useCameraDevice('back', {
  physicalDevices: [
    'ultra-wide-angle-camera',
    'telephoto-camera',
    'wide-angle-camera',
  ],
});

const format =
  device &&
  getCameraFormat(device, [
    {fps: 20},
    {videoAspectRatio: screenAspectRatio},
    {videoResolution: 'max'},
    {photoAspectRatio: screenAspectRatio},
    {photoResolution: 'max'},
    {autoFocusSystem: 'contrast-detection'},
  ]);
<GestureDetector gesture={tap}>
      <Camera
        format={format}
        zoom={device.neutralZoom}
        device={device}
        ref={cameraRef}
        isActive={isActive}
        onError={onError}
        codeScanner={codeScanner}
      />
</GestureDetector>
{
  "id": "com.apple.avfoundation.avcapturedevice.built-in_video:7",
  "maxZoom": 123.75,
  "sensorOrientation": "portrait",
  "minFocusDistance": 2,
  "position": "back",
  "formats": [],
  "supportsFocus": true,
  "supportsRawCapture": false,
  "neutralZoom": 2,
  "physicalDevices": [
    "ultra-wide-angle-camera",
    "wide-angle-camera",
    "telephoto-camera"
  ],
  "hardwareLevel": "full",
  "isMultiCam": true,
  "hasTorch": true,
  "supportsLowLightBoost": false,
  "maxExposure": 8,
  "name": "Rear triple camera",
  "hasFlash": true,
  "minExposure": -8,
  "minZoom": 1
}
"react-native-vision-camera": "^4.5.2",
"react-native": "^0.75.4"

@tgreco Did you manage to find a solution?

@tgreco
Copy link
Author

tgreco commented Nov 5, 2024

No solution as of yet unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants