I am trying to write Android Instrumented test using Espresso. When I run the test I get this error
java.lang.IllegalStateException: No instrumentation registered! Must run under a registering instrumentation.
I can't understand what this error means.
I will briefly explain what I am doing in my test. I followed the samples given by google and EspressoTesting Tutorial
@SmallTest
@RunWith(AndroidJUnit4.class)
public class ActivityInputTest {
@Rule
public ActivityTestRule<ActivityInput> aiRule = new ActivityTestRule<>(ActivityInput.class);
@Before
public void setUp(){}
}
When I run the test the error occurs at annotation @Rule
. Can I get some explanation why this happens or what is the issue behind this? I am not interested in working code but more on the actual problem behind the issue.