1

I have a problem with library. I copy `

compile ('de.psdev.licensesdialog:licensesdialog:1.8.0') 

to gradle and when sync I get error:

Warning:Conflict with dependency 'com.google.code.findbugs:jsr305'. Resolved versions for app (3.0.0) and test app (2.0.1) differ.

Any ideas how can I resolve my problem and use that library in my project.

ArtKorchagin
  • 4,801
  • 13
  • 42
  • 58
edi233
  • 3,511
  • 13
  • 56
  • 97
  • 2
    Probably you should have look int this post http://stackoverflow.com/a/28641446/2793134 – Nitin Mesta Dec 01 '15 at 18:27
  • 1
    Possibly you use `'com.google.code.findbugs:jsr305'` in your own project and `'de.psdev.licensesdialog:licensesdialog:1.8.0'` is also implement it, but with different versions. – Afshin Dec 01 '15 at 18:27

2 Answers2

4

I resolve my problem:

compile ('de.psdev.licensesdialog:licensesdialog:1.8.0') { exclude group: 'com.google.code.findbugs', module: 'jsr305' }

edi233
  • 3,511
  • 13
  • 56
  • 97
  • That's not a very maintainable solution. If the test app ever drops the `jsr305` dependency you'll also lack it for `licensesdialog` which depends on it. Better look at a Gradle `resolutionStrategy` to force the version as described in the answer linked from the comment by @nitin-mesta. – sschuberth Dec 01 '15 at 18:59
2

This happens because the main APK and the test APK use the same library (com.google.code.findbugs) but in different versions (your main APK use version 3.0.0 while your test APK use 2.0.1). So you need to tell to gradle to use for test the updated library. Just add

androidTestCompile 'com.google.code.findbugs:jsr305:3.0.0'

to your gradle file :)

Paolo Moschini
  • 352
  • 3
  • 3