14

I have a single, simple unit test in my Android app module:

/src/test/java/org.acme.test/SimpleTest.java

When I run:

./gradlew clean testDebug --tests='*.SimpleTest'

I get this exception:

java.lang.Exception: Custom runner class AndroidJUnit4 should have a public constructor with signature AndroidJUnit4(Class testClass)

Why does it think 'AndroidJUnit4' is a custom runner class, when it's a final class?

1
  • Why do you keep tests annotated with AndroidJUnit4 in src/test/ directory? Shouldn't it be in src/androidTest directory? Commented Sep 20, 2016 at 10:39

1 Answer 1

2

You might have the test class in test directory instead of androidTest.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.