natario1 / CameraView

📸 A well documented, high-level Android interface that makes capturing pictures and videos easy, addressing all of the common issues and needs. Real-time filters, gestures, watermarks, frame processing, RAW, output of any size.
https://natario1.github.io/CameraView
Other
4.89k stars 922 forks source link

New crash in some Camera1 devices #1251

Open EzequielAdrianM opened 9 months ago

EzequielAdrianM commented 9 months ago

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.