Skip to content

Instantly share code, notes, and snippets.

@fatorx
Created October 6, 2015 13:41
Show Gist options
  • Save fatorx/a261977169a639fa6d41 to your computer and use it in GitHub Desktop.
Save fatorx/a261977169a639fa6d41 to your computer and use it in GitHub Desktop.
Android - Error Public Constructor in Instrumentation TestCase
Error desc:
junit.framework.AssertionFailedError: Class fatorx.com.br.testdriven.MainActivityTest has no public constructor
TestCase(String name) or TestCase()
When creating the test class, and automatically implemented in some cases the constructor as follows below:
public MainActivityTest(Class<MainActivity> activityClass) {
super(activityClass);
}
The solution for this error is the following: create a constructor as follows:
public MainActivityTest() {
super(MainActivity.class);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment