java.lang.IncompatibleClassChangeError when including espresso-contrib:2.0

后端 未结 4 780
谎友^
谎友^ 2021-01-04 12:14

I have a subclass of android.support.v7.widget.RecyclerView. It works fine when I use the application and testing.

However, when I include espresso-contrib in my gra

4条回答
  •  [愿得一人]
    2021-01-04 12:41

    please use Newest Gradle Plugin (is not a stable version)

    Starting with 2.0.0 of the Android Gradle Plugin, Gradle build will fail if the main APK and the test APK use the same library (e.g. Guava) but in different versions.

    To make the build succeed, just add a dependency for the newer version to the build.gradle

    for example:

    androidTestCompile "com.android.support:recyclerview-v7:${supportLibVersion}"
    

    reference:

    • java.lang.IncompatibleClassChangeError when using espresso-contrib
    • Resolving conflicts between main and test APK

提交回复
热议问题