phonegap / phonegap-plugin-barcodescanner

cross-platform BarcodeScanner for Cordova / PhoneGap
MIT License
1.27k stars 1.42k forks source link

Unable to build with cordova-plugin-firebase-messaging #878

Closed jringbox closed 4 years ago

jringbox commented 4 years ago

Expected Behaviour

Successful build

Actual Behaviour

The following output occurs when building.

D8: Program type already present: android.support.v4.app.INotificationSideChannel

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
  Program type already present: android.support.v4.app.INotificationSideChannel

Reproduce Scenario (including but not limited to)

Create a cordova project and add the following packages.

cordova plugin add cordova-support-google-services
cordova plugin add cordova-plugin-firebase-messaging
cordova plugin add phonegap-plugin-barcodescanner

Steps to Reproduce

See above.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android API 29

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

N/A

Cordova CLI version and cordova platform version

9.0.0 (cordova-lib@9.0.1)

Installed platforms: android 8.1.0 Available platforms: browser ^6.0.0 electron ^1.0.0 ios ^5.0.0 osx ^5.0.0 windows ^7.0.0

Plugin version

phonegap-plugin-barcodescanner 8.1.0 "BarcodeScanner"

Sample Code that illustrates the problem

N/A

Logs taken while reproducing problem

See above.

jringbox commented 4 years ago

Nevermind. Someone told me to install cordova-plugin-androidx and cordova-plugin-androidx-adapter and that fixed it.