0
votes

I'm building android app using ionic4 and capacitor. I intent to use phonegap-plugin-barcodescanner in my app. But after installing that plugins, I began to fail building my apk. The hint I get from my Android Studio IDE is, that my app gradle using 'com.android.support:appcompat-v7:28.0.0', and the cordova gradle using "com.android.support:support-v4:27.+". I've tried to edit the cordova gradle to v4:28.0.0 (In Android Studio IDE), but still not working. What should I do?

My stack is: node.js 6.4.1 ionic 4.12.0 angular 7.3.9 capacitor 1.0

and plugins phonegap-plugin-barcodescanner ^8.1.0

1

1 Answers

0
votes

Could you show us the build.gradle files entirely?

I installed the plug-in on my project with Capacitor, and there was no problem. Remove the plug-in, and do these steps :

  • npm install phonegap-plugin-barcodescanner
  • npm install @ionic-native/barcode-scanner
  • ionic cap sync

from https://ionicframework.com/docs/native/barcode-scanner

I was dealing with issues using android and not androidX, so I did then :

Refactor --> Migrate to AndroidX --> No Backup --> Do Refactor

Then do Build --> Rebuild Project

This worked for me