Phonegap-plugin-barcodescanner: Android M issues. Due to new intent/permissions

Created on 9 Feb 2016  Â·  26Comments  Â·  Source: phonegap/phonegap-plugin-barcodescanner

I've been having a lot of issues getting the scanner working on Marshmallow, and it all seems to be due to the use on Intent rather than requesting Permissions.

The people working on the cordova-plugin-camera project hit the same issue. https://github.com/apache/cordova-plugin-camera/pull/142

Is this something that can be easily resolved?

bug android6

Most helpful comment

I rewritten the plugin and resolved this problem.

cordova plugin add https://github.com/jrontend/phonegap-plugin-barcodescanner

All 26 comments

:+1:

I'm getting "Sorry, the Android camera encountered a problem..." The logs say:

02-09 14:32:35.589   198   822 W ServiceManager: Permission failure: android.permission.CAMERA from uid=10178 pid=13777
02-09 14:32:35.589   198   822 E CameraService: Permission Denial: can't use the camera pid=13777, uid=10178
02-09 14:32:35.589 13777 13777 W CameraBase: An error occurred while connecting to camera: 0

02-09 14:32:35.590 13777 13777 W CaptureActivity: Unexpected error initializing camera
02-09 14:32:35.590 13777 13777 W CaptureActivity: java.lang.RuntimeException: Fail to connect to camera service
...

@poshaughnessy that is indeed the same issue. Fixed using the same temporary fix. Wondering what we can do to provide a more bulletproof fix for the longterm.

I've resolved this by using the fork from https://github.com/phonegap/phonegap-plugin-barcodescanner/pull/143

cordova plugin add https://github.com/kbytesys/phonegap-plugin-barcodescanner.git#android-zxing-integration

I seem to have no issues with the barcode scanner when I used Visual Studio and Cordova to use it. Once I use Ionic and ngCordova, the plugin does not seem to work, maybe that can provide some help?

Using that fork (https://github.com/kbytesys/phonegap-plugin-barcodescanner.git#android-zxing-integration) will require the installation of another Play Store app that scans barcodes. Whenever the scan function is called, it will instead open the secondary application. Is there no other way to have a lightweight QR code scanner, instead of a pluging that requires another app to work?

I rewritten the plugin and resolved this problem.

cordova plugin add https://github.com/jrontend/phonegap-plugin-barcodescanner

@JrontEnd +1

@JrontEnd It works perfectly with Ionic and ngCordova! Are there any ways to set settings or configuration for it?

@SammyIsra I don't have the environment of ngCordova,but you can try it.

@JrontEnd I just did, it worked nicely (I edited the last message too late)

Are there any settings on the reader?

@SammyIsra Nothing,the permission is requested automatically.

@JrontEnd so there is no way to avoid the "beep" the reader makes?
Thank you for your contribution, I had forgotten about this plugin!

@SammyIsra Haha, I am glad to see the plugin helpful to you.

@JrontEnd you are awesome :D THX !!!

works like a charm..thank you @JrontEnd

@JrontEnd Maybe try to propose a PR of your plugin, it can be really useful !
Thanks though ;)

@guardezi
I have a good news.The pull request is merged, you can add the plugin of latest version in phonegap repository.

@JrontEnd thanks your plugin resolved the issue.

Is there any other plugin available? without installing another supporting app in device?

Hi, i have found an issue if you have this pb (10/2016 !).
Don't use cordova plugin add phonegap-plugin-barcodescanner -> 4.0.2 !!!
but cordova plugin add https://github.com/jrontend/phonegap-plugin-barcodescanner -> 4.1.0

I am using ionic with ngcordova. By using,
cordova plugin add https://github.com/jrontend/phonegap-plugin-barcodescanner

using this plugin barcode scanner is opening. but i am not able get the scanned result..

any solution???

Use this one :
Remove the old
ionic plugin add https://github.com/Telerik-Verified-Plugins/BarcodeScanner https://github.com/Telerik-Verified-Plugins/BarcodeScanner —save
ionic platform remove ios
ionic platform remove android
ionic add platform ios
ionic add platform android
ionic state save

Le 25 oct. 2016 à 06:45, Smohanapriya [email protected] a écrit :

I am using ionic with ngcordova. By using,
cordova plugin add https://github.com/jrontend/phonegap-plugin-barcodescanner

this plugin for me barcode scanner is opening. but i am not able get the scan it...

any solution???

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/167#issuecomment-255935341, or mute the thread https://github.com/notifications/unsubscribe-auth/ASvttabp44A77ltKv5vJYEJF7_M1WfvYks5q3YlPgaJpZM4HWXcD.

This plugin,

ionic plugin add https://github.com/Telerik-Verified-Plugins/BarcodeScanner

also not working for me. I am using android marshmallow...

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />

Im using nougat ... But can you explain with more details and your code ?
The camera is oppening or not ?

Le 26 oct. 2016 06:46, "Smohanapriya" [email protected] a écrit :

This plugin,

ionic plugin add https://github.com/Telerik-Verified-Plugins/
BarcodeScanner

also not working for me. I am using android marshmallow...

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/167#issuecomment-256248448,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ASvttRxVhW-8-rHYE9v1Z5H4uguqdbsUks5q3ts3gaJpZM4HWXcD
.

This thread has been automatically locked.

Was this page helpful?
0 / 5 - 0 ratings