Skip to content
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

Error with the Barcode scanner on build #3906

Closed
loicparent opened this issue Dec 14, 2021 · 3 comments
Closed

Error with the Barcode scanner on build #3906

loicparent opened this issue Dec 14, 2021 · 3 comments

Comments

@loicparent
Copy link

loicparent commented Dec 14, 2021

Hello,

I'm submitting a ...
[ x] bug report
[ ] feature request
[ ] support request

Current behavior:
I encounter an issue when I try to build on Android Studio an app using the plugin ionic-native + barcode scanner.
In fact, It seems that this plugin is not compatible with the version 12.2 of Angular.
More precisely, I have an error with the use of the method "compile" instead of the method "implementation".

Also, I notice that the phonegap project is archived.
So my question is:
Is this expected to be updated to be compatible or do I have to switch to the capacitor plugin?

Expected behavior:
The build should be generated correctly.

Steps to reproduce:

  1. Install Ionic + Capacitor at the latest version and with Angular 12.2

  2. Install the barcode plugins
    => npm install phonegap-plugin-barcodescanner
    => npm install @awesome-cordova-plugins/barcode-scanner
    => ionic cap sync

  3. Open Android Studio with the build
    => ionic cap run anroid --open

  4. Try to run the project to see the error.

Related code:

Similar to this code : https://ionicframework.com/docs/native/barcode-scanner

Error indicated:

FAILURE: Build failed with an exception.

* Where:
Script '/Users/loicparent/noomia/sites/totemus/app/app-v1/node_modules/phonegap-plugin-barcodescanner/src/android/barcodescanner.gradle' line: 9

* What went wrong:
A problem occurred evaluating script.
> Could not find method compile() for arguments [{name=barcodescanner-release-2.1.5, ext=aar}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Ionic:

   Ionic CLI                     : 6.18.1 (…/.nvm/versions/node/v14.15.0/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.8.1
   @angular-devkit/build-angular : 0.901.15
   @angular-devkit/schematics    : 9.1.15
   @angular/cli                  : 9.1.15
   @ionic/angular-toolkit        : 3.1.1

Capacitor:

   Capacitor CLI      : 3.2.4
   @capacitor/android : 3.3.2
   @capacitor/core    : 3.3.2
   @capacitor/ios     : 3.2.4

Cordova:

   Cordova CLI       : not installed
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res (update available: 0.15.4) : 0.15.3
   native-run (update available: 1.5.0)   : 1.4.1

System:

   ios-sim : 8.0.2
   NodeJS  : v14.15.0 (…/.nvm/versions/node/v14.15.0/bin/node)
   npm     : 6.14.8
   OS      : macOS Big Sur
   Xcode   : Xcode 13.0 Build version 13A233

Thanks,
Loïc

@robkorv
Copy link

robkorv commented Jan 3, 2022

@loicparent I got the same issue. It can be fixed by applying this patch phonegap/phonegap-plugin-barcodescanner#851. I guess because the project is stale, it is not going to be merged.

I'm going to try the capacitor plugin. I will miss the torch option though. That could be handy in dimly lit environments.

@loicparent
Copy link
Author

Thank you for your reply!
This is what I have done to fix temporarily the issue but yes, I will try the capacitor plugin too.

@dylanvdmerwe
Copy link
Contributor

dylanvdmerwe commented Mar 15, 2022

Can anyone provide information on how to get this working from the PR? I had to fork and apply the code change myself. Note the PR does fix the issue btw.

dylanvdmerwe pushed a commit to dylanvdmerwe/phonegap-plugin-barcodescanner that referenced this issue Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants