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
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: