Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

java.lang.NullPointerException@android.hardware.camera2.CameraCaptureSession.capture #261

Open
jjn2004 opened this issue Nov 27, 2018 · 6 comments

Comments

@jjn2004
Copy link

jjn2004 commented Nov 27, 2018

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.hardware.camera2.CameraCaptureSession.capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession$CaptureCallback, android.os.Handler)' on a null object reference
41
at com.google.android.cameraview.Camera2.lockFocus(Camera2.java:29)
42
at com.google.android.cameraview.Camera2.takePicture(Camera2.java:4)
43
at com.google.android.cameraview.CameraView.takePicture(CameraView.java:2)
44
at com.louisgeek.louiscustomcamera.CameraActivity.onClick(CameraActivity.java:14)
45
at java.lang.reflect.Method.invoke(Method.java)

I run into the issue on HUAWEI 8.0.0 phones, EDI-AL10 and HWI-AL00, 8.0.0 does anyone have solution ?

@pansaipan
Copy link

我也碰到这个问题

@AvikSh14
Copy link

I faced this problem too in a Samsung device. In other devices camera works fine. What is the reason behind this problem and how to solve it?

@ngocphung247
Copy link

Can you try add Thread.sleep(200) before call capture

@chinahope
Copy link

I faced thie problem too in android9 vivo v1831A

@kkhuluwa
Copy link

I faced thie problem too in android9 vivo v1831A

I faced this too in vivo A9

@prajwalmw
Copy link

Any solution anyone found on this guys?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants