react-native-camera-kit icon indicating copy to clipboard operation
react-native-camera-kit copied to clipboard

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

Open latobibor opened this issue 2 years ago • 3 comments

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):

  • Device: Pixel 3 emulator (API 31)
  • OS: Android 12

Additional context react-native version: 0.71.2

latobibor avatar Apr 14 '23 23:04 latobibor

+1

marcoimme avatar May 30 '23 16:05 marcoimme

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.

scarlac avatar Jun 29 '23 18:06 scarlac

[...] 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:

  • I wish to take a photo and save it
  • I wish to use Android Emulator as well

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

latobibor avatar Jun 30 '23 19:06 latobibor