title: Android Espresso: "No test were found" , "Process crashed"
body: <p>When testing my Android app with Espresso, I noticed that running an AndroidTest configured with <code>All in Module</code> finds no tests, while running <code>All in Package</code> succeeds. </p>
  
  <p>I created the following reproducible case:</p>
  
  <ul>
  <li>Use wizard to create new clean application with minSdk 8 and empty Activity</li>
  <li>Configure gradle with espresso dependencies etc. (see below)</li>
  <li>Create AndroidTest <code>Run Configuration</code> with option <code>All in Module</code> and one with <code>All in Package</code></li>
  <li>Add class with tests (see below)</li>
  <li>Run with <code>All in Package</code>: Test passed</li>
  <li>Run with <code>All in Module</code>: No tests were found</li>
  </ul>
  
  <p>Running with <code>All in Module</code> worked fine until a few days ago. The changes I recall having made are upgrading Android Studio to 1.4 and upgrading <code>Android Support Library</code> to 23.1.0 and <code>Android Support Repository</code> to 24.0.0.</p>
  
  <p>Btw. also <code>gradlew connectedCheck</code> and <code>gradlew createDebugAndroidTestCoverageReport</code> fail now.</p>
  
  <p>Does anyone have suggestions to solve this issue?</p>
  
  <p>build.gradle for app:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.1"
  
      defaultConfig {
          applicationId "com.example.xyz.apptest"
          minSdkVersion 8
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
          debug {
              testCoverageEnabled true
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.1.0'
  
      androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.1') {
          // Necessary if your app targets Marshmallow (since Espresso
          // hasn't moved to Marshmallow yet)
          exclude group: 'com.android.support', module: 'support-annotations'
      }
      androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.1') {
          // Necessary if your app targets Marshmallow (since Espresso
          // hasn't moved to Marshmallow yet)
          exclude group: 'com.android.support', module: 'support-annotations'
          exclude group: 'com.android.support', module: 'appcompat'
          exclude group: 'com.android.support', module: 'support-v4'
          exclude module: 'recyclerview-v7'
      }
      androidTestCompile('com.android.support.test.espresso:espresso-idling-resource:2.2.1') {
          // Necessary if your app targets Marshmallow (since Espresso
          // hasn't moved to Marshmallow yet)
          exclude group: 'com.android.support', module: 'support-annotations'
      }
      androidTestCompile('com.android.support.test:runner:0.4.1') {
          // Necessary if your app targets Marshmallow (since the test runner
          // hasn't moved to Marshmallow yet)
          exclude group: 'com.android.support', module: 'support-annotations'
      }
      androidTestCompile('com.android.support.test:rules:0.4.1') {
          // Necessary if your app targets Marshmallow (since the test runner
          // hasn't moved to Marshmallow yet)
          exclude group: 'com.android.support', module: 'support-annotations'
  
      }
  }
  </code></pre>
  
  <p>Test.java</p>
  
  <pre><code>@RunWith(AndroidJUnit4.class)
  public class Test1 {
  
      @Rule
      public ActivityTestRule&lt;MainActivity&gt; activityTestRule =
              new ActivityTestRule&lt;&gt;(MainActivity.class, true, false);
  
      @Before
      public void setUp() {
          activityTestRule.launchActivity(new Intent());
      }
  
      @After
      public void cleanUp() {
      }
  
      @Test
      public void test() {
      }
  }
  </code></pre>
  
  <p>Trace in Run window:</p>
  
  <pre><code>Testing started at 12:14 ...
  Waiting for device.
  Target device: 3_2_API_10 [emulator-5554]
  Uploading file
      local path: C:\Users\xyz\Documents\Development\AndroidStudio\AppTest\app\build\outputs\apk\app-debug.apk
      remote path: /data/local/tmp/com.example.xyz.apptest
  No apk changes detected.
  Skipping file upload, force stopping package instead.
  DEVICE SHELL COMMAND: am force-stop com.example.xyz.apptest
  Uploading file
      local path: C:\Users\xyz\Documents\Development\AndroidStudio\AppTest\app\build\outputs\apk\app-debug-androidTest-unaligned.apk
      remote path: /data/local/tmp/com.example.xyz.apptest.test
  No apk changes detected.
  Skipping file upload, force stopping package instead.
  DEVICE SHELL COMMAND: am force-stop com.example.xyz.apptest.test
  Running tests
  Test running startedTest running failed: Instrumentation run failed due to 'Process crashed.'
  Empty test suite.
  </code></pre>
  
  <p>logcat: No susceptible differences found.</p>