New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn;t work on Android 6 #36

Closed
Kolyall opened this Issue Feb 3, 2016 · 7 comments

Comments

Projects
None yet
4 participants
@Kolyall

Kolyall commented Feb 3, 2016

FATAL EXCEPTION: main
                                                                     Process: com.waterworx.android, PID: 5836
                                                                     java.lang.RuntimeException: Fail to connect to camera service
                                                                         at android.hardware.Camera.<init>(Camera.java:495)
                                                                         at android.hardware.Camera.open(Camera.java:341)
                                                                         at com.google.zxing.client.android.camera.open.GingerbreadOpenCameraInterface.open(GingerbreadOpenCameraInterface.java:57)
                                                                         at com.google.zxing.client.android.camera.open.CameraManager.openDriver(CameraManager.java:77)
                                                                         at com.dlazaro66.qrcodereaderview.QRCodeReaderView.surfaceCreated(QRCodeReaderView.java:110)
                                                                         at android.view.SurfaceView.updateWindow(SurfaceView.java:583)
                                                                         at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:177)
                                                                         at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
                                                                         at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2055)
                                                                         at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
                                                                         at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
                                                                         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
                                                                         at android.view.Choreographer.doCallbacks(Choreographer.java:670)
                                                                         at android.view.Choreographer.doFrame(Choreographer.java:606)
                                                                         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
                                                                         at android.os.Handler.handleCallback(Handler.java:739)
                                                                         at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                         at android.os.Looper.loop(Looper.java:148)
                                                                         at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
@havidarou

This comment has been minimized.

Show comment
Hide comment
@havidarou

havidarou Feb 3, 2016

I faced a similar issue a few days ago.

I don't know why, but you have to actually give permission in the app for
the camera, even if you included it in the manifest...

On 3 February 2016 at 14:49, Nick Unuchek notifications@github.com wrote:

FATAL EXCEPTION: main
Process: com.waterworx.android, PID: 5836
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.(Camera.java:495)
at android.hardware.Camera.open(Camera.java:341)
at com.google.zxing.client.android.camera.open.GingerbreadOpenCameraInterface.open(GingerbreadOpenCameraInterface.java:57)
at com.google.zxing.client.android.camera.open.CameraManager.openDriver(CameraManager.java:77)
at com.dlazaro66.qrcodereaderview.QRCodeReaderView.surfaceCreated(QRCodeReaderView.java:110)
at android.view.SurfaceView.updateWindow(SurfaceView.java:583)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:177)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2055)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)


Reply to this email directly or view it on GitHub
#36.

havidarou commented Feb 3, 2016

I faced a similar issue a few days ago.

I don't know why, but you have to actually give permission in the app for
the camera, even if you included it in the manifest...

On 3 February 2016 at 14:49, Nick Unuchek notifications@github.com wrote:

FATAL EXCEPTION: main
Process: com.waterworx.android, PID: 5836
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.(Camera.java:495)
at android.hardware.Camera.open(Camera.java:341)
at com.google.zxing.client.android.camera.open.GingerbreadOpenCameraInterface.open(GingerbreadOpenCameraInterface.java:57)
at com.google.zxing.client.android.camera.open.CameraManager.openDriver(CameraManager.java:77)
at com.dlazaro66.qrcodereaderview.QRCodeReaderView.surfaceCreated(QRCodeReaderView.java:110)
at android.view.SurfaceView.updateWindow(SurfaceView.java:583)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:177)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2055)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)


Reply to this email directly or view it on GitHub
#36.

@Kolyall

This comment has been minimized.

Show comment
Hide comment
@Kolyall

Kolyall Feb 3, 2016

@havidarou How to do that? Can you provide a code?

Kolyall commented Feb 3, 2016

@havidarou How to do that? Can you provide a code?

@havidarou

This comment has been minimized.

Show comment
Hide comment
@havidarou

havidarou Feb 3, 2016

No need code. Go settings>apps>your app and click on permissions, turn on
the camera one.
On 3 Feb 2016 17:55, "Nick Unuchek" notifications@github.com wrote:

@havidarou https://github.com/havidarou How to do that? Can you provide
a code?


Reply to this email directly or view it on GitHub
#36 (comment)
.

havidarou commented Feb 3, 2016

No need code. Go settings>apps>your app and click on permissions, turn on
the camera one.
On 3 Feb 2016 17:55, "Nick Unuchek" notifications@github.com wrote:

@havidarou https://github.com/havidarou How to do that? Can you provide
a code?


Reply to this email directly or view it on GitHub
#36 (comment)
.

@Kolyall

This comment has been minimized.

Show comment
Hide comment
@Kolyall

Kolyall Feb 3, 2016

@havidarou But the app crashes... How to avoid crashes on customer side?

Kolyall commented Feb 3, 2016

@havidarou But the app crashes... How to avoid crashes on customer side?

@havidarou

This comment has been minimized.

Show comment
Hide comment
@havidarou

havidarou Feb 3, 2016

I don't know how to make this work without you explicitly doing that,
because android 6 has introduced permission request at runtime so it should
be permission relates, I just found this work around for testing purposes :/
On 3 Feb 2016 17:59, "Nick Unuchek" notifications@github.com wrote:

@havidarou https://github.com/havidarou But the app crashes... How to
avoid crashes on customer side?


Reply to this email directly or view it on GitHub
#36 (comment)
.

havidarou commented Feb 3, 2016

I don't know how to make this work without you explicitly doing that,
because android 6 has introduced permission request at runtime so it should
be permission relates, I just found this work around for testing purposes :/
On 3 Feb 2016 17:59, "Nick Unuchek" notifications@github.com wrote:

@havidarou https://github.com/havidarou But the app crashes... How to
avoid crashes on customer side?


Reply to this email directly or view it on GitHub
#36 (comment)
.

@vlntdds

This comment has been minimized.

Show comment
Hide comment
@vlntdds

vlntdds Feb 3, 2016

Contributor

Not an issue of QRCodeReaderView.
You have an issue with your application and the new permissions introduced on API23.
Read this about how to request permissions in runtime: http://developer.android.com/intl/pt-br/training/permissions/index.html

Contributor

vlntdds commented Feb 3, 2016

Not an issue of QRCodeReaderView.
You have an issue with your application and the new permissions introduced on API23.
Read this about how to request permissions in runtime: http://developer.android.com/intl/pt-br/training/permissions/index.html

@dlazaro66

This comment has been minimized.

Show comment
Hide comment
@dlazaro66

dlazaro66 Jul 17, 2016

Owner

As @vlntdds sais, this is not a QRCodeReaderView issue, since you need to check the Camera permission in runtime before using the view (please check: http://developer.android.com/intl/pt-br/training/permissions/index.html)

Owner

dlazaro66 commented Jul 17, 2016

As @vlntdds sais, this is not a QRCodeReaderView issue, since you need to check the Camera permission in runtime before using the view (please check: http://developer.android.com/intl/pt-br/training/permissions/index.html)

@dlazaro66 dlazaro66 closed this Jul 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment