wizpanda / cordova-plugin-firebase-lib

This repository is moving & merging to https://github.com/wizpanda/cordova-plugin-firebase-lib to avoid confusion to developers.
https://www.wizpanda.com/
MIT License
68 stars 39 forks source link

Compiling error v4.0.1 #18

Closed yoprogramo closed 5 years ago

yoprogramo commented 5 years ago

Error compiling project (compiles ok before adding this plugin)

To Reproduce

My plugins are:

cordova-plugin-advanced-geolocation 1.1.0 "Cordova Advanced Geolocation Plugin - Android" cordova-plugin-background-download 0.0.2 "Background Download" cordova-plugin-badge 0.8.8 "Badge" cordova-plugin-camera 4.0.3 "Camera" cordova-plugin-device 2.0.2 "Device" cordova-plugin-file 6.0.1 "File" cordova-plugin-googlemaps 2.6.2 "cordova-plugin-googlemaps" cordova-plugin-headsetdetection 3.0.0 "Headset Detection" cordova-plugin-inappbrowser 3.0.0 "InAppBrowser" cordova-plugin-insomnia 4.3.0 "Insomnia (prevent screen sleep)" cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification" cordova-plugin-native-spinner 1.1.3 "Native Spinner" cordova-plugin-purchase 8.1.1 "Purchase" cordova-plugin-whitelist 1.3.3 "Whitelist" cordova-plugin-zip 3.1.0 "cordova-plugin-zip"

I compile fine with these, then

cordova plugin add cordova-plugin-firebase-lib

Expected behavior

The project fails to compile

Console Logs

` 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

`

Plugin Version

4.0.1

Desktop (please complete the following information):

kfrederix commented 5 years ago

I am currently getting the same error on windows 10 with v4.0.1. (i can build my app with v3.3.0 + cordova-android v8.0.0 without any errors)

ghost commented 5 years ago

i have created an empty project with these dependencies only:

"dependencies": {
    "cordova-android": "^8.0.0",
    "cordova-plugin-camera": "^4.0.3",
    "cordova-plugin-firebase-lib": "4.0.1"
  },
"cordova": {  
    "plugins": {  
      "cordova-plugin-firebase-lib": {},  
      "cordova-plugin-whitelist": {},  
      "cordova-plugin-camera": {}  
    },  
    "platforms": [  
      "android"  
    ]  
  },  

after adding cordova-plugin-camera, i've got these Errors:

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

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
> 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$Stub
katsuhidem commented 5 years ago

v4.0.1 use AndroidX, but cordova-plugin-camera is not yet supported

davidzxc12 commented 5 years ago

Hi @sagrawal31 Is there any update to fix this? thanks

sagrawal31 commented 5 years ago

Can you try running:

cordova plugin add cordova-plugin-androidx
biblioeteca commented 5 years ago

Can you try running:

cordova plugin add cordova-plugin-androidx

Yes, it works but requires Cordova@9

davidzxc12 commented 5 years ago

Can you try running:

cordova plugin add cordova-plugin-androidx

after install cordova-plugin-androidx and cordova-plugin-androidx-adapter

It's works!! thx

tevla commented 5 years ago

thanks @davidzxc12 it did fix the issue and you do need to install cordova-plugin-androidx and cordova-plugin-androidx-adapter

sagrawal31 commented 5 years ago

Documented this at https://github.com/wizpanda/cordova-plugin-firebase-lib#androidx