robertlevonyan/camerax-demo

Camera Stopped when we capture Photo

Closed this issue · 1 comments

We are getting the below error on the log console if we are capturing the photo. Please help me if anyone have already fixed it.

java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List android.hardware.camera2.params.OutputConfiguration.getSurfaces()' on a null object reference
at android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onCaptureErrorLocked(CameraDeviceImpl.java:2130)
at android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onDeviceError(CameraDeviceImpl.java:1800)
at android.hardware.camera2.legacy.CameraDeviceUserShim$CameraCallbackThread$CallbackHandler.handleMessage(CameraDeviceUserShim.java:309)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loop(Looper.java:206)
at android.os.HandlerThread.run(HandlerThread.java:65)

************ DEVICE INFORMATION ***********
Brand: lenovo
Device: manning
Model: Lenovo K8 Note
Id: OMB27.43-70
Product: manning_retail

************ FIRMWARE ************
SDK: 26
Release: 8.0.0
Incremental: 77
App version : 1.0.3

CameraX is still on alpha, so I don't recommend to use it in production.