0

When I implement these two dependencies in my project:

  • For BTC implementation 'org.bitcoinj:bitcoinj-core:0.14.7'

  • For BCH implementation 'cash.bitcoinj:bitcoincashj-examples:0.14.5.2'

This error will occur:

Caused by: com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'org.bitcoin.production.checkpoints.txt'

How can I resolve this?

Grant Miller
  • 27,532
  • 16
  • 147
  • 165
Sid009
  • 421
  • 5
  • 16

1 Answers1

-1

This issue appears because bitcoincashj-examples library also transit org.bitcoinj:bitcoinj-core:0.14.5.2 dependency.

All that you need to do is exclude org.bitcoinj:bitcoinj-core:0.14.5.2 dependency from bitcoincashj-examples library.

implementation 'org.bitcoinj:bitcoinj-core:0.14.7'
implementation ('cash.bitcoinj:bitcoincashj-examples:0.14.5.2'){
    exclude group: 'cash.bitcoinj', module: 'bitcoinj-core'
}
Oleg Sokolov
  • 1,134
  • 1
  • 12
  • 19
  • I have try this suggestion but it gives an another error **Program type already present: org.slf4j.impl.StaticLoggerBinder Message{kind=ERROR, text=Program type already present: org.slf4j.impl.StaticLoggerBinder, sources=[Unknown source file], tool name=Optional.of(D8)}** – Sid009 Aug 17 '18 at 05:30
  • @Sam_S please edit your question and add full build.gradle – Oleg Sokolov Aug 17 '18 at 05:42
  • implementation 'org.bitcoinj:bitcoinj-core:0.14.7' implementation ('cash.bitcoinj:bitcoincashj-examples:0.14.5.2'){ exclude group: 'cash.bitcoinj', module: 'bitcoinj-core' } annotationProcessor "org.androidannotations:androidannotations:4.2.0" implementation "org.androidannotations:androidannotations-api:4.2.0" implementation 'org.slf4j:slf4j-api:1.7.25' implementation 'org.slf4j:slf4j-simple:1.7.20' – Sid009 Aug 17 '18 at 06:00
  • this is my dependencies for using btc and bch – Sid009 Aug 17 '18 at 06:03
  • @Sam_S try to remove implementation 'org.slf4j:slf4j-api:1.7.25' dependency from your build.gradle, because the slf4j-simple library already transit it to your project – Oleg Sokolov Aug 17 '18 at 06:13
  • Its not working for bch. It creates only btc wallet in both. – Sid009 Aug 18 '18 at 05:02
  • @Sam_S I can only suggest you give me your full build.gradle file, and I will try to give you a solution – Oleg Sokolov Aug 18 '18 at 10:01