0

I am getting below error,

  Error:Conflict with dependency 'com.google.guava:guava' in project ':app'.
  Resolved versions for app (18.0) and test app (16.0.1) differ

after adding the below line..

compile 'com.mobgen.halo.android:halo-plugin:2.0.0'

to dependencies in build.gradle file

below is the snapshot of build.gradle file

enter image description here

i tried adding below 2 approaches in build.gradle file, but didnt work

1.

configurations.all {
    resolutionStrategy.force 'com.google.guava:guava:18.0'
}

2.

  androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') {
        exclude group: 'com.google.guava:guava'
    }
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
kumar
  • 708
  • 4
  • 15
  • 39
  • 1
    guys i dont know who is down voting and for what reason :S if possible try to help.. it will help others as well.. – kumar Apr 18 '17 at 13:26

1 Answers1

1

2 things:

  1. You're looking at the wrong thing. Guava is not a dependency of Espresso. It's a dependency of testng.
  2. Although I might not be entirely correct saying that you're excluding guava in a wrong way, but the following scheme will work for sure:

androidTestCompile ("org.testng:testng:6.9.6"){
    exclude group: 'com.google.guava', module:'guava'
}
Bartek Lipinski
  • 30,698
  • 10
  • 94
  • 132
  • I am having the same issue as him and the solution above does not solve it. Any ideas? –  Jun 06 '18 at 08:18
  • @guest176969 look at the `dependencies` gradle task dump (you might need to dump it to a file because of the amount of text). Maybe it's included in something else as well. – Bartek Lipinski Jun 06 '18 at 09:12