Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on build, Duplicate class #24

Closed
jdla1990 opened this issue Jul 27, 2016 · 4 comments
Closed

Error on build, Duplicate class #24

jdla1990 opened this issue Jul 27, 2016 · 4 comments

Comments

@jdla1990
Copy link

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!

@ramzed
Copy link

ramzed commented Aug 9, 2016

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"

@jdla1990
Copy link
Author

jdla1990 commented Aug 9, 2016

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!

@ramzed
Copy link

ramzed commented Aug 9, 2016

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

It works! :)

@FlorinMotoc
Copy link

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 android@6.3.0 and cordova plugin cordova-plugin-compat which is deprecated and creates issues on build with android@6.3.0+.

Hope it helps somebody.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants