teslamotors / react-native-camera-kit

A high performance, easy to use, rock solid camera library for React Native apps.
MIT License
2.42k stars 577 forks source link

` CAMERA_ERROR (3): The camera device has encountered a serious error` on react-native version 0.71.2 when trying to capture image #538

Open latobibor opened 1 year ago

latobibor commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Minimal repro repository:

https://github.com/latobibor/react-native-camera-kit-error-repro

  1. Press "Open camera" button
  2. Click the white circle to take an image

Expected behavior My passed function "onBottomButtonPressed" should have been called back with the resulting photo.

Actual behavior Image freezes for a second, there is no callback. In Android logcat this error shows up the first time. There is no error and no callback afterwards.

Publishing new public camera state CameraState{type=OPENING, error=StateError{code=3, cause=null}}
{Camera@8f46f85[id=0]} Resetting Capture Session
Session 0: Exception while stopping repeating:
    android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error
        at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:2350)

Smartphone (please complete the following information):

Additional context react-native version: 0.71.2

marcoimme commented 1 year ago

+1

scarlac commented 1 year ago

Are you able to reproduce this without using CameraScreen? We'd like to get rid of this component and stick to the native APIs, as it's not possibly to design a camera that everyone likes.

latobibor commented 1 year ago

[...] stick to the native APIs, as it's not possibly to design a camera that everyone likes.

What do you mean by "to stick with the native APIs"? Any solution would be fine given there's an alternative. My scenario is very simple:

So I can skip using CameraScreen if there is an alternative for that.