Cordova-plugin-firebase: Error on build, Duplicate class

Created on 27 Jul 2016  ·  4Comments  ·  Source: arnesson/cordova-plugin-firebase

Hi everyone!

Error output:
`:compileDebugNdk UP-TO-DATE
:compileDebugSources
:prePackageMarkerForDebug
:transformClassesWithJarMergingForDebug FAILED

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 14.071 secs

  • What went wrong:
    Execution failed for task ':transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzpx.class

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    Error: cmd: Command failed with exit code 1 Error output:
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzpx.class

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.`

Plugin list:
cordova-plugin-compat 1.0.0 "Compat" cordova-plugin-device 1.1.2 "Device" cordova-plugin-file 4.2.0 "File" cordova-plugin-file-opener2 2.0.2 "File Opener2" cordova-plugin-file-transfer 1.5.1 "File Transfer" cordova-plugin-firebase 0.1.9 "Google Firebase Plugin" cordova-plugin-geolocation 2.2.0 "Geolocation" cordova-plugin-inappbrowser 1.4.0 "InAppBrowser" cordova-plugin-network-information 1.2.1 "Network Information" cordova-plugin-splashscreen 3.2.2 "Splashscreen" cordova-plugin-whitelist 1.2.2 "Whitelist" cordova-plugin-x-toast 2.5.2 "Toast" plugin.google.maps 1.3.9 "phonegap-googlemaps-plugin"

Any idea to resolve? Thanks!

Most helpful comment

I know this is closed but google redirected me here many times and didn't found the answer to my problem.

On my side, the error was from the combination between cordova platform [email protected] and cordova plugin cordova-plugin-compat which is deprecated and creates issues on build with [email protected]+.

Hope it helps somebody.

All 4 comments

Hi all,
I have the same issue.
@jdla1990 did you resolve this problem?

Plugin list:
cordova-plugin-console 1.0.3 "Console"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-firebase 0.1.9 "Google Firebase Plugin"
cordova-plugin-googleplus 4.0.9 "Google+"
cordova-plugin-inappbrowser 1.4.0 "InAppBrowser"
cordova-plugin-keyboard 1.1.4 "Keyboard"
cordova-plugin-network-information 1.2.1 "Network Information"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-whitelist 1.2.2 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"
me.tonny.cordova.plugins.multidex 0.1.0 "Cordova Multi Dex"

Hi @ramzed, Yes, the solution is set same version of library in gradle. i.e,

in build.gradle
compile "com.google.android.gms:play-services-maps:9.2.1"
compile "com.google.android.gms:play-services-location:9.2.1"
compile "com.google.firebase:firebase-core:9.2.1"
compile "com.google.firebase:firebase-messaging:9.2.1"
compile "com.google.firebase:firebase-crash:9.2.1"
compile "com.google.firebase:firebase-config:9.2.1"

in cordova-plugin-firebase:
classpath 'com.google.gms:google-services:3.0.0'

And try again!

Thank you @jdla1990
I changed all versions in my platforms/android/project.properties
Now all libraries have the same version.

It works! :)

I know this is closed but google redirected me here many times and didn't found the answer to my problem.

On my side, the error was from the combination between cordova platform [email protected] and cordova plugin cordova-plugin-compat which is deprecated and creates issues on build with [email protected]+.

Hope it helps somebody.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arunkatariaoodles picture arunkatariaoodles  ·  4Comments

rolinger picture rolinger  ·  5Comments

matthitachi picture matthitachi  ·  5Comments

JonSmart picture JonSmart  ·  3Comments

stephan-nordnes-eriksen picture stephan-nordnes-eriksen  ·  5Comments