This error happens when I try and run my Android Instrumentation tests on a new 4.4 device, when they have always worked in the past
[echo] Running tests...
[echo] Running tests ...
[exec] INSTRUMENTATION_RESULT: shortMsg=java.lang.NoClassDefFoundError
[exec] INSTRUMENTATION_RESULT: longMsg=java.lang.NoClassDefFoundError: org.mockito.internal.runners.RunnerImpl
[exec] INSTRUMENTATION_CODE: 0
I posted that question to help others avoid wasting time stupidly like I have done!
The problem was that when I upgraded my Nexus 4 to Android 4.4 Kitkat, I decided to play around by activating the new Android RunTime (ART) in the Developer's Options settings menu.
That is the result!
To run your instrumentation tests, switch back to Dalvik!
I'm using Mockito, Dexmaker and Dexmaker-Mockito all to run Instrumentation tests with Mockito and use Emma to get coverage data.
No doubt some updating or change of approach will be needed in the future to test on Dalvik and/or ART.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With