I have implemented project by using third party library(zxing) after implementation project is working fine then after I have written one test project to unit test my projec
I have this error on api level lower than 21. Just the build->rebuild project helped me.
I got this error because I was working with Guava and Espresso also contains Guava.
If you use Gradle and Android Studio you can exclude packages from the dependency like this:
androidTestCompile('com.jakewharton.espresso:espresso:1.1-r3') {
exclude group: 'com.google.guava'
}
You are getting this error because of third party library reference added two times. You have added the application path in the build path of test project. so the library reference automatically added to test project". Remove any library reference in the test project under properties->android.
FYI, click here for detail explanation.