title: Android Studio runs Instrumentation tests as Junit Tests
body: <p>I have my instrumentation tests located in a separate module. I have applied the plugin <code>"com.android.test"</code> in <code>build.gradle</code> file and when I call <code>gradle connectedCheck</code>, the tests in the main source set are executing as instrumentation tests as expected on the device.</p>
  
  <p>But when I try to run it from Android Studio (by right-clicking on a class and selecting Run), it tries to run the tests as normal Junit tests and give the following error:</p>
  
  <pre><code>!!! JUnit version 3.8 or later expected:
  
  java.lang.RuntimeException: Stub!
      at junit.runner.BaseTestRunner.&lt;init&gt;(BaseTestRunner.java:5)
      at junit.textui.TestRunner.&lt;init&gt;(TestRunner.java:54)
      at junit.textui.TestRunner.&lt;init&gt;(TestRunner.java:48)
      at junit.textui.TestRunner.&lt;init&gt;(TestRunner.java:41)
      at com.intellij.rt.execution.junit.JUnitStarter.junitVersionChecks(JUnitStarter.java:224)
      at com.intellij.rt.execution.junit.JUnitStarter.canWorkWithJUnitVersion(JUnitStarter.java:207)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:61)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:131)
  
  Process finished with exit code -3
  </code></pre>
  
  <p>I tried to edit the configuration and add a new <strong>Android Instrumented Tests</strong> configuration, but as soon as I select my test module, it displays </p>
  
  <pre><code>Error: The current project cannot be run
  </code></pre>
  
  <p>Note: The instrumentation tests in <code>src/androidTest/java</code> and the Junit tests in <code>src/test/java</code> work fine as they should. So, there's no dependency problems. The only problem is with a test module itself.</p>