question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add excludes to Android Gradle files to prevent common errors due to expected duplicates

See original GitHub issue

Issue details

Currently the Android project can fail to compile (due to detected duplicate files in included libraries) even if the files are somewhat expected - like licenses or RoboVM meta-data.

Proposed solution: add something along these lines to Android build.gradle files.

Reproduction steps/code

You can easily reproduce this issue by including two libraries with robovm.xml, like gdx-kiwi and gdx-lml. See https://github.com/czyzby/gdx-lml/issues/46

Use these dependencies in the core or android Gradle project to reproduce the issue due to duplicate META-INF/robovm/ios/robovm.xml file:

    dependencies {
        // ...
        compile "com.github.czyzby:gdx-lml:1.9.1.9.4-SNAPSHOT"
        compile "com.github.czyzby:gdx-autumn:1.9.1.9.4-SNAPSHOT"
        compile "com.kotcrab.vis:vis-ui:1.1.1"
    }

Version of LibGDX and/or relevant dependencies

gdx-setup 1.9.4 (and below).

Affected platforms

  • Android
  • iOS (robovm)
  • iOS (MOE)
  • HTML/GWT
  • Windows
  • Linux
  • MacOS

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Tom-Skicommented, Oct 26, 2016

You have duplicate robovm.xml files in the same jar, what is the reason for that? If you can provide an example where this happens due to valid dependencies we can do something about this, but this looks like an issue in your artifacts.

0reactions
Tom-Skicommented, Oct 27, 2016

Thanks for the reproducible example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle 7 requires duplicatesStrategy for "fake" duplicates
Gradle 7 rightfully requires a duplicatesStrategy for handling duplicate files. However, the respective error can also be produced by adding ...
Read more >
Android Studio: Resolving Duplicate Classes - gradle
However, if there are no duplicate files and there is still a "Duplicate classes" error, look for the name in the rest of...
Read more >
How do I exclude specific transitive dependencies of ...
Subproject B depends on module M which has a required dependency on X. /a/build.gradle: dependencies { compile libraries.l }. /b/build.gradle:
Read more >
Manage manifest files - Android Developers
This page describes how our build tools ingest manifest files to determine the ultimate look and experience of your app.
Read more >
[SOLVED] Duplicated classes when building for Android
CommandInvokationFailure: Gradle build failed. ... FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ': ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found