title: Android espresso error no tests found
body: <p>I try to use Espresso test framework for testing my app.</p>
  
  <p>Env:</p>
  
  <p>Android Studio RC1 (from canary)
  Latest Android Gradle plugin, 0.14+</p>
  
  <p>I added as described here (<a href="https://code.google.com/p/android-test-kit/wiki/Espresso#Getting_Started" rel="nofollow noreferrer">https://code.google.com/p/android-test-kit/wiki/Espresso#Getting_Started</a>)</p>
  
  <pre><code>dependencies {
      //espresso - test framework
  
      androidTestCompile files('libs/espresso-1.1.jar',
              'libs/testrunner-1.1.jar',
              'libs/testrunner-runtime-1.1.jar')
  
      androidTestCompile 'com.google.guava:guava:14.0.1',
              'com.squareup.dagger:dagger:1.1.0',
              'org.hamcrest:hamcrest-core:1.1',
              'org.hamcrest:hamcrest-integration:1.1',
              'org.hamcrest:hamcrest-library:1.1'
  }
  
   packagingOptions {
          exclude 'LICENSE.txt'
      }
  
  defaultConfig {
          //espresso - test framework
          testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"
      }
  </code></pre>
  
  <p>Also I created simple test: </p>
  
  <pre><code>public class StartActivityTest extends ActivityInstrumentationTestCase2&lt;StartActivity&gt; {
      public StartActivityTest(Class&lt;StartActivity&gt; activityClass) {
          super(activityClass);
      }
  
      @Override
      public void setUp() throws Exception {
          super.setUp();
          // Espresso will not launch our activity for us, we must launch it via getActivity().
          getActivity();
      }
  
      public void testStartVisibility() {
          onView(withId(R.id.app_title))
                  .check(matches(isDisplayed()));
  
          onView(withId(R.id.app_thumb))
                  .check(matches(isDisplayed()));
  
          onView(withId(R.id.label))
                  .check(matches(isDisplayed())
                  );
  
          onView(withId(R.id.label)).check(matches(withText("Hello Espresso!")));
      }
  
  }
  </code></pre>
  
  <p>But i get an error: </p>
  
  <pre><code>com.android.builder.testing.ConnectedDevice &gt; hasTests[Nexus 5 - 5.0] FAILED 
  No tests found.                           
  :app:connectedAndroidTest FAILED          
  
  FAILURE: Build failed with an exception.
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/6Khnn.png" alt="See  screenshot for detailes"></p>