Hey! Im using Compose Multiplatform and im pulling...
# android
s
Hey! Im using Compose Multiplatform and im pulling in some dependencies to be used on both Desktop and Android Ive added the dependencies in the common gradle file like this:
Copy code
val commonMain by getting {
    dependencies {
        api(compose.runtime)
        api(compose.foundation)
        api(compose.material3)
        api(compose.materialIconsExtended)
        implementation("org.cloudburstmc.protocol:bedrock-connection:3.0.0.Beta1-SNAPSHOT")
        implementation("io.wollinger:serverchest-api:0.0.1")
        implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
    }
}
My own local dependency (maven local, io.wollinger:serverchest) works fine, "bedrock-connection" gets pulled correctly too and shows up. If i run the desktop version it runs fine, but on android it complains about duplicate classes:
Copy code
Duplicate class it.unimi.dsi.fastutil.objects.ObjectObjectImmutablePair found in modules jetified-core-8.5.13-SNAPSHOT (org.cloudburstmc.fastutil:core:8.5.13-SNAPSHOT:20230812.171723-2) and jetified-object-common-8.5.13-SNAPSHOT (org.cloudburstmc.fastutil.commons:object-common:8.5.13-SNAPSHOT:20230812.171723-2)
Ive before "fixed" this by building the library as a jar and manually removing duplicate files. Can anyone help me figure out the correct way to properly exclude those or just tell android to "Exclude" duplicate files, like you would on a "normal" gradle jar task?
1
Oops. Turns out what i previously found out on the internet was true, i was just doing it wrong. I simply need to exclude one of them. i think i read it wrong, i thought they were the same. Sorry! Solution:
Copy code
implementation("org.cloudburstmc.protocol:bedrock-connection:3.0.0.Beta1-SNAPSHOT") {
    exclude("org.cloudburstmc.fastutil.commons", "object-common")
}