mrousavy / react-native-vision-camera

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

🐛 ins iOS iphone 11, Camera get blank screen #3149

Closed ViralGroovy closed 2 weeks ago

ViralGroovy commented 2 weeks ago

What's happening?

In iOS device iPhone 11, When i try to open camera at that time got White blank screen.

Reproduceable Code

const cameraRef = useRef(null);
  const [cameraDevice, setCameraDevice] = useState("back");
  const device = useCameraDevice(cameraDevice, {
    physicalDevices: ['ultra-wide-angle-camera', 'wide-angle-camera', 'telephoto-camera'],
  });
  const format = useCameraFormat(device, [
      { 
        photoResolution: 'max'
      },
      {
        fps: 'max',
      },
      {
        iso: 'max'
      },
  ])

<Camera
              ref={cameraRef}
              style={{ 
                flex: 1,
              }}
              isActive={isCameraOpen}
              photo={true}
              video={true}
              device={device}
              enableZoomGesture={true}
              audio={true}
              enableHighQualityPhotos
              format={format}
            />

Relevant log output

Exception thrown while executing UI block: UIGraphicsBeginImageContext() failed to allocated CGBitampContext:

Camera Device

{
  "hasTorch": true,
  "isMultiCam": false,
  "id": "com.apple.avfoundation.avcapturedevice.built-in_video:0",
  "supportsRawCapture": false,
  "physicalDevices": [
    "wide-angle-camera"
  ],
  "neutralZoom": 1,
  "supportsFocus": true,
  "hasFlash": true,
  "name": "Back Camera",
  "minExposure": -8,
  "minZoom": 1,
  "formats": [],
  "position": "back",
  "hardwareLevel": "full",
  "minFocusDistance": 12,
  "maxZoom": 189,
  "maxExposure": 8,
  "supportsLowLightBoost": false,
  "sensorOrientation": "landscape-right"
}

Device

iPhone 11 (17.6.)

VisionCamera Version

^3.9.2

Can you reproduce this issue in the VisionCamera Example app?

No, I cannot reproduce the issue in the Example app

Additional information

maintenance-hans[bot] commented 2 weeks ago

Guten Tag, Hans here! 🥨

Thanks for reporting ze issue. It looks like you have provided some helpful information, but I need to clarify some parts for mrousavy to assist you better.

First zings first, could you please check your Xcode logs for more detailed output around ze time zej white screen occurs? This will help pinpoint if it's a library issue or something related to your device state.

Also, I noticed you mentioned you are not able to reproduce ze issue in ze Example app. This indicates it might be an issue related to your specific setup. Please provide some details about your environment, such as your Expo version and whether you have any other conflicting packages.

If you continue to have trouble after zis, you might consider sponsoring ze project here for more direct support from mrousavy!

Let’s work together to solve zis!

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

mrousavy commented 2 weeks ago

Upgrade to VisionCamera V4.