codenameone / CameraKitCodenameOne

A cross platform API for low level camera access
3 stars 5 forks source link

Camera Demo doesn't work on Android Oreo #1

Open moovida opened 6 years ago

moovida commented 6 years ago

I tested the demo on Pixel 2 XL with Android Oreo.

Taking pictures and video doesn't trigget any message (from the code it looks like I should have some message).

I get the following log sent by email, it might help.

[main] 0:0:19,483 - Codename One revisions: d4219a1b829854d15136d1fa3166990e01f1b197

[main] 0:0:19,486 - Exception: java.lang.RuntimeException - setParameters failed
java.lang.RuntimeException: setParameters failed
        at android.hardware.Camera.native_setParameters(Native Method)
        at android.hardware.Camera.setParameters(Camera.java:1945)
        at com.wonderkiln.camerakit.Camera1.adjustCameraParameters(Camera1.java:804)
        at com.wonderkiln.camerakit.Camera1.adjustCameraParameters(Camera1.java:779)
        at com.wonderkiln.camerakit.Camera1.openCamera(Camera1.java:671)
        at com.wonderkiln.camerakit.Camera1.start(Camera1.java:124)
        at com.wonderkiln.camerakit.CameraView$2.run(CameraView.java:266)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.os.HandlerThread.run(HandlerThread.java:65)
[EDT] 0:0:21,108 -  : java.lang.RuntimeException: setParameters failed
[EDT] 0:0:21,110 -  : java.lang.RuntimeException: setParameters failed
[main] 0:0:23,282 - Exception: java.lang.RuntimeException - setParameters failed
java.lang.RuntimeException: setParameters failed
        at android.hardware.Camera.native_setParameters(Native Method)
        at android.hardware.Camera.setParameters(Camera.java:1945)
        at com.wonderkiln.camerakit.Camera1.adjustCameraParameters(Camera1.java:804)
        at com.wonderkiln.camerakit.Camera1.adjustCameraParameters(Camera1.java:779)
        at com.wonderkiln.camerakit.Camera1.openCamera(Camera1.java:671)
        at com.wonderkiln.camerakit.Camera1.start(Camera1.java:124)
        at com.wonderkiln.camerakit.Camera1.setFacing(Camera1.java:192)
        at com.wonderkiln.camerakit.CameraView$3.run(CameraView.java:339)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.os.HandlerThread.run(HandlerThread.java:65)
codenameone commented 6 years ago

This exception is a known issue in the camera kit library. They should release a 1.0 version soon and we'll migrate to that. It would hopefully resolve this issue.

codenameone commented 6 years ago

I mean the native Android library we rely on here...