newlogic/smartscanner-capacitor

[`Task :app:processDebugMainManifest FAILED`] Cannot run latest version 0.5.0-beta.7

rs2-davebanguilan opened this issue · 5 comments

Current Behaviour

Failed running app with the latest version of the plugin.
Shows error:
image

Expected Behaviour

Should be able to run without errors.

Steps to Reproduce the Problem

  1. Create new application using ionic start appName blank
  2. Install plugin npm i @idpass/smartscanner-capacitor
  3. Add android: ionic cap android
  4. Sync: ionic cap sync
  5. Run: ionic cap run android
  6. Build will not proceed and an error will occur

Context


Ionic:

   Ionic CLI                     : 6.19.1 (C:\Users\dave.banguilan\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 6.4.1
   @angular-devkit/build-angular : 15.0.4
   @angular-devkit/schematics    : 15.0.4
   @angular/cli                  : 15.0.4
   @ionic/angular-toolkit        : 6.1.0

Capacitor:

   Capacitor CLI      : 4.6.1
   @capacitor/android : 4.6.1
   @capacitor/core    : 4.6.1
   @capacitor/ios     : 4.6.1

Utility:

   cordova-res : 0.15.4
   native-run  : 1.7.1

System:

   NodeJS : v16.14.0 (C:\Program Files\nodejs\node.exe)
   npm    : 8.3.1
   OS     : Windows 10

image
Try add this line to your app AndroidManifest.xml inside <activity>...</activity>

Hi @megaxayda, android:exported="true" is already added by default in capacitor-V4.

I noticed that there is some changes on the .aar files in the feature/capacitor-v4 branch, so I removed my .aar files that came from feature/capacitor-v3 then replaced it with the files from feature/capacitor-v4. The android:exported error was gone and the application was able to build. When executing the executeScanner method from the plugin, the app crashes. There were no error logs in the capacitor level, but upon debugging using Android studio I found this:

image

Are you guys using different .aar files?

Hi @megaxayda, android:exported="true" is already added by default in capacitor-V4.

I noticed that there is some changes on the .aar files in the feature/capacitor-v4 branch, so I removed my .aar files that came from feature/capacitor-v3 then replaced it with the files from feature/capacitor-v4. The android:exported error was gone and the application was able to build. When executing the executeScanner method from the plugin, the app crashes. There were no error logs in the capacitor level, but upon debugging using Android studio I found this:

image

Are you guys using different .aar files?

Woah this is similar to what happened to me,
But for me to fix this is to add this in the build.gradle

implementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false }
implementation 'com.google.zxing:core:3.3.0'

which is really weird fix.

hello @rs2-davebanguilan Thank you for creating this ticket, can you try it in 0.5.0-beta.9 this issue should be fix without importing the dependencies yourself.

Hi @nicholemnl. I can confirm that your solution works. I tested it on Android for both mrz and nfc-scan modes. Thank you