Eclipse + Android + JUnit test references android.os class = NoClassDefFoundError WTF
- by Peter Pascale
I have a custom timer that extends android.os.CountDownTimer. I have a test in the test project (standard Android/Eclipse project config) that tests the custom Timer. When I try to run this test, I get a
java.lang.NoClassDefFoundError: android/os/CountDownTimer
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:698)
You get the idea. Can I not run code that references android code code in junit test?