0

我得到以下错误,

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

添加以下行后..

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

到 build.gradle 文件中的依赖项

below is the snapshot of build.gradle file

在此处输入图像描述

我尝试在 build.gradle 文件中添加以下两种方法,但没有奏效

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'
    }
4

1 回答 1

1

2件事:

  1. 你看错东西了。Guava不是 的依赖项Espresso。它是 的依赖项testng
  2. 尽管我可能不完全正确地说您以错误的方式排除番石榴,但以下方案肯定会起作用:

androidTestCompile ("org.testng:testng:6.9.6"){
    exclude group: 'com.google.guava', module:'guava'
}
于 2017-04-19T11:07:59.517 回答