androidgradlebouncycastlebitcoinj

Two Android Dependencies have same dependency, and duplicate class Error


enter image description here

I use xrpl-core and bitcoinj libs, and both use bouncycastle version 1.72.
I got the above error (screenshot) when building my andriod app.
I tried excluding bcprov from the package, but it's still not working.

dependencies {
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'org.bitcoinj:bitcoinj-core:0.17-alpha1'
    implementation('org.xrpl:xrpl4j-core:3.0.1') {
        exclude group: 'bcprov-jdk18on', module: 'library'
    }
}

Solution

  • The group should be the dependency path and the module should be the specific part you want to exclude, for example:

    group: "org.bouncycastle"
    module: "bcprov-jdk18on"