By

Problem
When creating a test class with ActivityUnitTestCase and running with Junit the following error is thrown: “java.lang.RuntimeException: Exception during suite construction android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests”

Cause
The Android framework failed to create the test due to some unexpected class structure e.g. no default constructor

Solution
Add a default constructor e.g.:

public MainActivityUnitTest() {
		super(MainActivity.class);
}

where MainActivity.class is the class under test

Share