capacitor-community / barcode-scanner

A fast and efficient (QR) barcode scanner for Capacitor
MIT License
437 stars 172 forks source link

unable to use in android #165

Closed Darkmagister closed 1 year ago

Darkmagister commented 2 years ago

Describe the bug i'm trying this plugin to test the barcode functionality, i have installed following the readme but i get

ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(HomePageModule)[BarcodeScanner -> BarcodeScanner -> BarcodeScanner -> BarcodeScanner]: 
      NullInjectorError: No provider for BarcodeScanner!
    NullInjectorError: R3InjectorError(HomePageModule)[BarcodeScanner -> BarcodeScanner -> BarcodeScanner -> BarcodeScanner]: 
      NullInjectorError: No provider for BarcodeScanner!

in android studio

To Reproduce Steps to reproduce the behavior:

i'm starting from a blank project ionic with angular, installed the plugin, edited the AndroidManifest.xml file in the home page of the project i just added a button that should call a function with the example function from the readme, after installing the app on the device after the start, the app doesn't show the button and i get that error

Expected behavior showing the app and scan

Desktop (please complete the following information):

Smartphone (please complete the following information):

here you can see the test app: https://github.com/Darkmagister/testbarcode

thegnuu commented 2 years ago

I will have a look at this as soon as possible, unfortunately I am really busy at the moment...

thegnuu commented 1 year ago

@Darkmagister sorry it took me so long to respond!

I was able to start your project without any issues, the only thing that prevented the scanner from being visible is the --ion-background-color css variable which need to be set to transparent. Otherwise I had no issues with your project on my Huawei test device.

Feel free to reopen this issue if the problem still exists!