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.

Fix class duplicates

See original GitHub issue

I’m using pureconfig v0.14.0. Running pantsbuild (v1.30.0) detect-duplicates multiple duplicates are detected:

$ ./pants detect-duplicates src/scala/myapp:main
...
 [detect-duplicates]

                    ===== For target JvmBinary(src/scala/com/eslgaming/services/gamehub/http4s_poc:main):
                   Duplicate classes and/or resources detected in artifacts: ('com.github.pureconfig-pureconfig-core_2.12-0.14.0.jar', 'com.github.pureconfig-pureconfig-macros_2.12-0.14.0.jar')
                        pureconfig/DerivationMacros$$anon$5.class
                        pureconfig/derivation/LazyContextParser.class
                        pureconfig/DerivationMacros$$typecreator2$1.class
                        pureconfig/DerivationMacros$$anon$1.class
                        pureconfig/derivation/LazyContextParser$LazyContext$.class
                        pureconfig/DerivationMacros$$anonfun$$nestedInanonfun$buildImplicitNotFound$1$1.class
                        pureconfig/Derivation$Successful$.class
                        pureconfig/derivation/LazyContextParser$LazyContextTree$$anon$2.class
                        pureconfig/derivation/MacroCompat$$typecreator1$1.class
                        pureconfig/Derivation$Successful.class
                        ... 20 more ...
                   Duplicate classes and/or resources detected in artifacts: ('com.github.pureconfig-pureconfig-generic-base_2.12-0.14.0.jar', 'com.github.pureconfig-pureconfig-generic_2.12-0.14.0.jar')
                        pureconfig/generic/CoproductHint$Attempt$.class
                        pureconfig/generic/CoproductHint$Use$.class
                        pureconfig/generic/error/CoproductHintException$.class
                        pureconfig/generic/ProductHint$Use.class
                        pureconfig/generic/ProductHint$Action.class
                        pureconfig/generic/ProductHint$UseOrDefault.class
                        pureconfig/generic/ProductHint$UseOrDefault$.class
                        pureconfig/generic/error/NoValidCoproductOptionFound$.class
                        pureconfig/generic/ProductHint$Use$.class
                        pureconfig/generic/ProductHintImpl.class
                        ... 18 more ...

Unfortunately, I cannot create a fat-jar if I have this kind of duplicates.

This issue is related to https://github.com/pureconfig/pureconfig/issues/430. Also reported in https://github.com/pantsbuild/pants/issues/11488.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
leifwicklandcommented, Nov 1, 2021

@sentenza Just to be explicit, this issue should be fixed. That said, we haven’t published a release with the fix, yet.

0reactions
ruippeixotogcommented, Oct 31, 2021

That’s a good insight @leifwickland, thanks for sharing! I guess it makes me a bit more comfortable removing OSGi support knowing that popular libraries did it too and got no complaints.

I know @jcazevedo is also on board with this, so I’ll open a PR to do it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Studio: Resolving Duplicate Classes - gradle
Delete files with duplicate jar extensions in the libs folder. However, if there are no duplicate files and ...
Read more >
Duplicate class error. Fixed - YouTube
How to fix a Duplicate class error in android studio.This error occurs when the Android Plugin can't decide which class to use when...
Read more >
How to fix Duplicate class error in android studio. - YouTube
CodingTony fixing android studio problems, So as usual watch a video to see a simple solution how to solve this error " Duplicate...
Read more >
Duplicate classes in managed assets can cause issues ... - IBM
To resolve the issue, you need to find the duplicate class and remove it. Check all of the managed asset JAR files for...
Read more >
Duplicate class - CommonsWare
You can try choosing one of those two artifacts and using exclude to block the other one. The good news is that this...
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