jeziellago / compose-markdown

Markdown Text for Android Jetpack Compose 📋.
MIT License
594 stars 51 forks source link

Conflicting dependencies error on trying to build project #103

Open kanitkarketki opened 5 months ago

kanitkarketki commented 5 months ago

I am trying to integrate this library into an existing project with the following declared as a dependency since I use both compose and regular xml in the project and explicitly use the Markwon library for xml. implementation("io.noties.markwon:image-coil:4.6.0") On trying to add this library as follows: implementation("com.github.jeziellago:compose-markdown:0.5.0") { exclude(group = "io.noties.markwon", module = "image-coil") exclude(group = "com.github.jeziellago:Markwon", module = "58aa5aba6a") (not sure if this is correct) } I get a conflicting dependency error like so:

Duplicate class io.noties.markwon.image.coil.CoilImagesPlugin found in modules jetified-Markwon-58aa5aba6a-runtime (com.github.jeziellago:Markwon:58aa5aba6a) and jetified-image-coil-4.6.0-runtime (io.noties.markwon:image-coil:4.6.0)
Duplicate class io.noties.markwon.image.coil.CoilImagesPlugin$1 found in modules jetified-Markwon-58aa5aba6a-runtime (com.github.jeziellago:Markwon:58aa5aba6a) and jetified-image-coil-4.6.0-runtime (io.noties.markwon:image-coil:4.6.0)
Duplicate class io.noties.markwon.image.coil.CoilImagesPlugin$2 found in modules jetified-Markwon-58aa5aba6a-runtime (com.github.jeziellago:Markwon:58aa5aba6a) and jetified-image-coil-4.6.0-runtime (io.noties.markwon:image-coil:4.6.0)
Duplicate class io.noties.markwon.image.coil.CoilImagesPlugin$CoilAsyncDrawableLoader found in modules jetified-Markwon-58aa5aba6a-runtime (com.github.jeziellago:Markwon:58aa5aba6a) and jetified-image-coil-4.6.0-runtime (io.noties.markwon:image-coil:4.6.0)
Duplicate class io.noties.markwon.image.coil.CoilImagesPlugin$CoilAsyncDrawableLoader$AsyncDrawableTarget found in modules jetified-Markwon-58aa5aba6a-runtime (com.github.jeziellago:Markwon:58aa5aba6a) and jetified-image-coil-4.6.0-runtime (io.noties.markwon:image-coil:4.6.0)
Duplicate class io.noties.markwon.image.coil.CoilImagesPlugin$CoilStore found in modules jetified-Markwon-58aa5aba6a-runtime (com.github.jeziellago:Markwon:58aa5aba6a) and jetified-image-coil-4.6.0-runtime (io.noties.markwon:image-coil:4.6.0)

If I remove the explicit coil dependency from the project as a test it works as expected but that is required for my project

jeziellago commented 4 months ago

Hi @kanitkarketki, Did you find a solution for this issue? The problem happens because there are two different libraries using Marwon classes. compose-markdown to work properly, depends on com.github.jeziellago:Markwon:58aa5aba6a, a modified version of Markwon adjusting Coil dependency. My suggestion is to remove implementation("io.noties.markwon:image-coil:4.6.0") and replace your Markwon dependency with com.github.jeziellago:Markwon:58aa5aba6a