metaplex-android
metaplex-android copied to clipboard
[Bug] Duplicate Dependency in latest library version
Describe the bug adding a gradle dependency for com.github.metaplex-foundation:metaplex-android:1.3.2 produces a dependency resolution error due both the kborsh-android and kborsh-jvm dependencies being pulled in
To Reproduce
- create an android app and add a dependency on com.github.metaplex-foundation:metaplex-android:1.3.2
- try to build the app
- see the error:
Duplicate class com.metaplex.base64.Base64Encoder found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.base64.Base64Encoder$DefaultImpls found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.base64.Base64Factory found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.buffer.ByteBuffer found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.buffer.ByteBuffer$Companion found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.buffer.ByteBuffer$DefaultImpls found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.buffer.ByteBufferKt found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.buffer.ByteOrder found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.buffer.JvmByteBuffer found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.buffer.JvmByteBuffer$WhenMappings found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.kborsh.Borsh found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.kborsh.Borsh$Default found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.kborsh.BorshDecoder found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Duplicate class com.metaplex.kborsh.BorshEncoder found in modules kborsh-android-0.1.0b1-runtime (com.github.metaplex-foundation.kborsh:kborsh-android:0.1.0b1) and kborsh-jvm-0.1.0b1 (com.github.metaplex-foundation.kborsh:kborsh-jvm:0.1.0b1)
Expected behavior The app should build when using the metaplex depdency
SDK Version & Context
- Version com.github.metaplex-foundation:metaplex-android:1.3.2
- Additional context
Additional context
- downgrading to `metaplex-android:1.3.0b3' removes the issue
- this issue can be fixed by manually resolving the dependency like so:
implementation("com.github.metaplex-foundation:metaplex-android:1.3.2") {
exclude("com.github.metaplex-foundation.kborsh", "kborsh-jvm")
}
https://github.com/metaplex-foundation/kborsh/issues/2