Arcane Android: Using espresso contrib 2.2.

The Error

If you encounter this error

java.lang.IncompatibleClassChangeError: com.yourpackage.SomeActivity

This is an indication that the espresso-contrib library has different dependencies to something already in your project. Espresso contrib 2.2.1 has a dependency on If you are using a newer version of the support-v4, or one of your dependancies has a newer version (appcompat-v7:23.1.1 for example) then this mysterious IncompatibleClassChangeError stacktrace will materialize.

The Solution

The solution is to exclude the offending items from the test class path by extending the dependency:

Thanks to Andrey Kolchev for his working solution on stack overflow

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.