title: No runnable methods on Android JUnit4 Instrumentation Tests
body: <p>I am new to Instrumentation Testing on Android and was learning from the sample at <a href="https://github.com/googlesamples/android-testing/tree/master/runner/AndroidJunitRunnerSample" rel="nofollow">https://github.com/googlesamples/android-testing/tree/master/runner/AndroidJunitRunnerSample</a> to use AndroidJUnit4.</p>
  
  <p>That code works perfectly.</p>
  
  <p>Trying to implement the same login on my project, however, I get the following exception:</p>
  
  <pre><code>Running tests
  Test running started
  java.lang.Exception: No runnable methods
  at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191)
  at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128)
  at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
  at org.junit.runners.ParentRunner.&lt;init&gt;(ParentRunner.java:84)
  at org.junit.runners.BlockJUnit4ClassRunner.&lt;init&gt;(BlockJUnit4ClassRunner.java:65)
  at android.support.test.internal.runner.junit4.AndroidJUnit4ClassRunner.&lt;init&gt;(AndroidJUnit4ClassRunner.java:38)
  at android.support.test.runner.AndroidJUnit4.&lt;init&gt;(AndroidJUnit4.java:36)
  at java.lang.reflect.Constructor.newInstance(Native Method)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
  at android.support.test.internal.runner.junit4.AndroidAnnotatedBuilder.buildAndroidRunner(AndroidAnnotatedBuilder.java:57)
  at android.support.test.internal.runner.junit4.AndroidAnnotatedBuilder.runnerForClass(AndroidAnnotatedBuilder.java:45)
  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
  at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
  at org.junit.runner.Computer.getRunner(Computer.java:40)
  at org.junit.runner.Computer$1.runnerForClass(Computer.java:31)
  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
  at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101)
  at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87)
  at org.junit.runners.Suite.&lt;init&gt;(Suite.java:81)
  at org.junit.runner.Computer.getSuite(Computer.java:28)
  at android.support.test.internal.runner.TestRequestBuilder.classes(TestRequestBuilder.java:791)
  at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:754)
  at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:341)
  at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:238)
  at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1853)
  </code></pre>
  
  <p>My AndroidTestSuite looks like:</p>
  
  <pre><code>import org.junit.runner.RunWith;
  import org.junit.runners.Suite;
  
  @RunWith(Suite.class)
  @Suite.SuiteClasses({InstrumentationTestSuite.class})
  public class AndroidTestSuite {}
  </code></pre>
  
  <p>And my InstrumentationTestSuite looks like:</p>
  
  <pre><code>import org.junit.runner.RunWith;
  import org.junit.runners.Suite;
  
  @RunWith(Suite.class)
  @Suite.SuiteClasses({LoginInstrumentationTest.class})
  public class InstrumentationTestSuite {}
  </code></pre>
  
  <p>My LoginInstrumentationTest is </p>
  
  <pre><code>@RunWith(AndroidJUnit4.class)
  @LargeTest
  public class LoginInstrumentationTest {
  
      @Rule
      public ActivityTestRule&lt;LoginActivity&gt; mActivityRule = new ActivityTestRule&lt;&gt;(
          LoginActivity.class);
  
      @Test
      public void attemptToLogin() {
          login("filipebarretto@xxxxxxxxxx.com", "12345678");
      }
  
      private void login(String email, String password) {
  
          // Enter user email
          onView(withId(R.id.email)).perform(typeText(email),
              closeSoftKeyboard());
  
          // Enter user password
          onView(withId(R.id.password)).perform(typeText(password),
              closeSoftKeyboard());
  
          // Click on the login button
          onView(withId(R.id.email_sign_in_button)).perform(click());
  
          // Testing
          onView(withId(R.id.email)).check(matches(withText(email)));
  
      }
  }
  </code></pre>
  
  <p>From what I search, usually the error I'm getting is due to a missing <code>@Test</code> before my method.</p>
  
  <p>The difference I noticed between my code and the one I'm learning from is the gradle version, which I use 1.5.0 and they use 2.0.0-beta2.</p>
  
  <p>I also found that my Instrumentation.java that is called during the test has several "Cannot resolve symbol" error with I can't find the reason, since I use the same dependencies as the sample code.</p>
  
  <p>Any one know what could be the reason of the <code>No runnable methods</code> exception and how to solve it?</p>