"No tests found" for lollipop

2,254 views
Skip to first unread message

Kevin Kovach

unread,
Nov 16, 2015, 3:19:36 PM11/16/15
to adt-dev
I have a library project that I've written tests for.

- My tests are in src/androidTest/java/
- I've set testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
- The test classes are @RunWith(AndroidJUnit4.class)
- Individual tests are annotated with @Test

I can execute a ./gradlew connectedCheck and the tests run well on a device with KitKat, but when I try to run the same tests the same way on a device with Lollipop I get...

15:02:15.784 [WARN] [org.gradle.api.Task] Tests on XT1095 - 5.1 failed: Instrumentation run failed due to 'java.lang.NoClassDefFoundError'
15:02:16.011 [WARN] [org.gradle.api.Task] 
com.android.builder.testing.ConnectedDevice > No tests found.[XT1095 - 5.1] FAILED 
15:02:16.011 [WARN] [org.gradle.api.Task] No tests found. This usually means that your test classes are not in the form that your test runner expects (e.g. don't inherit from TestCase or lack @Test annotations).

This is confusing and I'm at a loss as to what I'm missing or doing incorrectly. Has anyone else experienced this difference between versions? Please let me know what other information I can provide to try and figure this out. Thanks.

- Kevin

Mariusz S

unread,
Dec 2, 2015, 12:29:59 PM12/2/15
to adt-dev
Just to let you know - I am having the same problem for some time and still looking for a solution.

Michal Bendowski

unread,
Dec 3, 2015, 6:08:50 AM12/3/15
to adt-dev
Can you reproduce the problem on an emulator? Do you use applicationIdSuffix or anything else that would change the application id in the manifest?

Michal

Kevin Kovach

unread,
Dec 16, 2015, 7:37:49 PM12/16/15
to adt-dev
FYI, my problem ended up being a product of compiling the dagger 2 dagger-compile artifact into my application. You can find the details here, https://github.com/google/dagger/issues/271

If you determine you've having the same issue I've updated the README for gradle users here, https://github.com/kkovach/dagger/tree/update-install-gradle

- Kevin
Reply all
Reply to author
Forward
0 new messages