title: Android Instrumentation Testing: No instrumentation registered Error
body: <p>I am trying to write Android Instrumented test using Espresso. When I run the test I get this error</p>
  
  <blockquote>
    <p>java.lang.IllegalStateException: No instrumentation registered! Must run under a registering instrumentation.</p>
  </blockquote>
  
  <p>I can't understand what this error means.</p>
  
  <p>I will briefly explain what I am doing in my test. I followed the <a href="https://github.com/googlesamples/android-testing" rel="noreferrer">samples</a> given by google and <a href="https://github.com/LearnShareKnowledge/EspressoTestingUi" rel="noreferrer">EspressoTesting Tutorial</a></p>
  
  <pre><code>@SmallTest
  @RunWith(AndroidJUnit4.class)
  public class ActivityInputTest {
  
     @Rule
     public ActivityTestRule&lt;ActivityInput&gt; aiRule = new ActivityTestRule&lt;&gt;(ActivityInput.class);
  
  
     @Before
     public void setUp(){}
  }
  </code></pre>
  
  <p>When I run the test the error occurs at annotation <code>@Rule</code>. 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.</p>