camerakit-android icon indicating copy to clipboard operation
camerakit-android copied to clipboard

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.hardware.camera2.CaptureRequest

Open Greeeeyyyss opened this issue 6 years ago • 2 comments

Problem

Experiencing a crash on few users with devices below upon capturing an image. This issue is not reproducible on other devices like Samsung and Pixel. If it helps see logs:

Log

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.hardware.camera2.CaptureRequest android.hardware.camera2.impl.CameraDeviceImpl$CaptureCallbackHolder.getRequest(int)' on a null object reference at android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onCaptureErrorLocked + 2137(CameraDeviceImpl.java:2137) at android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onDeviceError + 1827(CameraDeviceImpl.java:1827) at android.hardware.camera2.legacy.CameraDeviceUserShim$CameraCallbackThread$CallbackHandler.handleMessage + 306(CameraDeviceUserShim.java:306) at android.os.Handler.dispatchMessage + 106(Handler.java:106) at android.os.Looper.loop + 164(Looper.java:164) at android.os.HandlerThread.run + 65(HandlerThread.java:65)

Environment

CameraKit Version: camerakit:1.0.0-beta3.10

Android Device: LG Tribute Empire, LG Stylo 4, MIRO (Foxx)

Android Version: 8.1.0

Question

  • I know the crash log is pointing to the camera hardware but is there a way to catch exception like this since is not caught on cameraView.errorListener?

  • Is this a dead end issue since the crash is only happening on rare devices? What could be the possible issue for those devices?

Greeeeyyyss avatar Oct 01 '19 08:10 Greeeeyyyss

I also got the crash on same device (oppo and vivo)

williamycyh avatar Jan 10 '20 03:01 williamycyh

I also got the crash on Xiaomi Redmi 5 Android 8.1.0

nikomp avatar Feb 02 '23 10:02 nikomp