natario1/CameraView

New crash in some Camera1 devices

EzequielAdrianM opened this issue · 0 comments

Hi Mattia!

Phones crashing:
Moto C plus (Android 7)
Samsung Galaxy A12 (Android 12)
Vivo V2028 (Android 12)

Exception java.lang.RuntimeException: getParameters failed (empty parameters)
  at android.hardware.Camera.native_getParameters
  at android.hardware.Camera.getParameters (Camera.java:3088)
  at com.otaliastudios.cameraview.engine.Camera1Engine$3.run (Camera1Engine.java:579)
  at com.otaliastudios.cameraview.engine.orchestrator.CameraStateOrchestrator$3.run (CameraStateOrchestrator.java:100)
  at com.otaliastudios.cameraview.engine.orchestrator.CameraOrchestrator$1.call (CameraOrchestrator.java:84)
  at com.otaliastudios.cameraview.engine.orchestrator.CameraOrchestrator$1.call (CameraOrchestrator.java:81)
  at com.otaliastudios.cameraview.engine.orchestrator.CameraOrchestrator$3.run (CameraOrchestrator.java:152)
  at com.otaliastudios.cameraview.internal.WorkerHandler.run (WorkerHandler.java:137)
  at com.otaliastudios.cameraview.engine.orchestrator.CameraOrchestrator.execute (CameraOrchestrator.java:147)
  at com.otaliastudios.cameraview.engine.orchestrator.CameraOrchestrator.access$100 (CameraOrchestrator.java:34)
  at com.otaliastudios.cameraview.engine.orchestrator.CameraOrchestrator$2.run (CameraOrchestrator.java:137)
  at android.os.Handler.handleCallback (Handler.java:836)
  at android.os.Handler.dispatchMessage (Handler.java:103)
  at android.os.Looper.loop (Looper.java:203)
  at android.os.HandlerThread.run (HandlerThread.java:61)

What can be done to fail safe and prevent the app crashing? Thanks and sorry, I know you are very busy.