App force quit with Barcode Scanner on device

Hi guys,

I have an application in ionic 3, I add barcode scanner feature to my app. It’s can be test smoothly with Ionic dev app. However, when I build android apk and run on device, my app force quit when I touch button to scan barcode.

Can anyone help me?

try debugging on Chrome Browser

Check the Console

Chrome Browser so cordova plugin is not available with Barcode Scanner :frowning:

Chrome’s Developer Tools can attach to browsers on devices.

Make sure your AndroidManifest.xml file has the right permissions in it. (platforms/android/app/src/main/AndroidManifest.xml). I had this same problem. Have a look at the plugin’s plugin.xml and make sure all the permissions make it to the AndroidManifest.xml

There is a bug in Cordova right now where sometimes the permissions in the plugin.xml file doesn’t make it to the manifest. (e.g. https://github.com/apache/cordova-common/pull/89).

When I added the permissions manually it started working.

'adb logcat ’ at a terminal window will usually show some kind of error you can track down.