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

Fatal exception on takePicture #67

Open
harshvishu opened this issue Dec 17, 2016 · 1 comment
Open

Fatal exception on takePicture #67

harshvishu opened this issue Dec 17, 2016 · 1 comment
Labels

Comments

@harshvishu
Copy link

Fatal Exception: java.lang.RuntimeException: takePicture failed
at android.hardware.Camera.native_takePicture(Camera.java)
at android.hardware.Camera.takePicture(Camera.java:1879)
at android.hardware.Camera.takePicture(Camera.java:1824)
at com.google.android.cameraview.Camera1.takePictureInternal(Camera1.java:228)
at com.google.android.cameraview.Camera1$2.onAutoFocus(Camera1.java:219)
at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1314)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:227)
at android.app.ActivityThread.main(ActivityThread.java:6100)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:859)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749)

Device: HTC One X9 dual sim
OS: 6.0

@yaraki yaraki added the bug label Dec 20, 2016
@harshvishu
Copy link
Author

harshvishu commented Dec 21, 2016

  1. I managed to stop the crashing by providing a Handler() in the callbacks of Camera2 where it was null.

  2. Also moving to legacy mode still crashes on this device. So, I bypassed that by commenting the code in method chooseCameraIdByFacing().

  3. And sometimes camera doesn't takes picture. Like when clicking quickly multiple times. The log in this case is below

convertRequestMetadata - control.awbRegions setting is not supported, ignoring value
W/LegacyRequestMapper: Only received metering rectangles with weight 0.
W/LegacyRequestMapper: Only received metering rectangles with weight 0.

This code has been a lot help to me. Hope this helps!

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

No branches or pull requests

2 participants