Add excludes to Android Gradle files to prevent common errors due to expected duplicates
See original GitHub issueIssue 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:
- Created 7 years ago
- Comments:10 (9 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Thanks for the reproducible example.