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.

"Duplicate class .. found in modules ..." triggered by appcompat and lets-plot-common libraries

See original GitHub issue

I am using the kotlin lets plot api, which works 100% on jupyter and in standalone apps,

however I’m trying to use it on an android app and at the moment to build I get a bunch of errors that say like this

Duplicate class kotlin.ArrayIntrinsicsKt found in modules jetified-kotlin-stdlib-1.3.72.jar (org.jetbrains.kotlin:kotlin-stdlib:1.3.72) and jetified-lets-plot-common-1.3.1.jar (org.jetbrains.lets-plot:lets-plot-common:1.3.1)

and

Duplicate class org.jetbrains.annotations.TestOnly found in modules jetified-annotations-13.0.jar (org.jetbrains:annotations:13.0) and jetified-lets-plot-common-1.3.1.jar (org.jetbrains.lets-plot:lets-plot-common:1.3.1)

I understand that I have to choose only one of the libraries to be compiled, but if I remove lets-plot from the gradle the project renders unusable at ‘grafica.kt’

My question is:

Can I remove ‘org.jetbrains.kotlin:kotlin-stdlib:1.3.72’ and ‘org.jetbrains:annotations:13.0’ safely? and If so, how can I do this?

Thanks in advance!

Project description: User inputs two numbers and the app displays a plot of them

I’ve opened the same issue at :

https://youtrack.jetbrains.com/issue/KT-39737

where I’ve attached a sample project

Plot_app.zip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
alshancommented, Jul 1, 2020

@descent2oblivion I’ve done what @ilya-g suggested. Could you try upgrading to lets-plot-kotlin-api 0.0.22-SNAPSHOT ? It depends on lets-plot-common 1.4.3-SNAPSHOT which is clear from Kotlin and other external dependencies.

2reactions
ilya-gcommented, Jun 26, 2020

It looks like lets-plot-common.jar artifact is an uber-jar that bundles classes from all of its dependencies, including kotlin-stdlib. This approach can cause problems in certain environments, for example in the modular Java environment on the module path or in Android apps as described above.

Consider providing your main artifact lets-plot-api that lists all its dependencies as plain dependencies instead of bundling them, and provide an uber-jar if needed as a distinct artifact variant or a separate artifact.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Duplicate class .. found in modules ..." triggered ... - YouTrack
"Duplicate class .. found in modules ..." triggered by appcompat and lets-plot-common libraries. I am using the kotlin lets plot api, which works...
Read more >
Duplicated classes found in modules classes.jar
Let's first understand the problem : · @aucd29 i am using this : implementation 'com.google.android.libraries.places:places:2.0.0' implementation ...
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 >
Solved Duplicate class org.intellij.found in modules jetified ...
Website- https://www.codingkaro.in/Donate On- UPI- shyptsolution@apl https://www.paypal.com/paypalme/shyptsolutionFor more tips-https://w...
Read more >
How to fix Duplicate class error in android studio. - YouTube
... how to solve this error " Duplicate class error" which is caused by a conflict of interest between support libraries and androidx...
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