Espresso Test Failing: No interface method trackUsage() in UsageTracker.java

I had the same problem. To fix it I changed the following dependencies from:

com.android.support.test:runner:1.0.0
com.android.support.test:rules:1.0.0

to:

com.android.support.test:runner:0.5
com.android.support.test:rules:0.5

UPDATE:

Michael's answer is better, don't use this outdated version anymore!


I was experiencing the same issue with rules 1.0.0 and runner 1.0.0. Though I was able to solve it by just adding espresso-core 3.0.0. Which avoids the use of outdated versions such as suggested in Erics answer.

com.android.support.test:rules:1.0.0 
com.android.support.test.runner:1.0.0 
com.android.support.test.espresso:espresso-core:3.0.0

EDIT: Meanwhile one should use the AndroidX libraries, the current versions as of 2021 / 12 are:

androidx.test:rules:1.4.0
androidx.test:runner:1.4.0
androidx.test:core:1.4.0
androidx.test.espresso:espresso-core:3.4.0

The up to date versions can in general be found on the Android Developers page.