title: Android: Test running failed: Instrumentation run failed due to 'java.lang.IncompatibleClassChangeError'
body: <p>I have some projects with several unit tests.
  When I try to execute tests in Android Studio or from terminal using <code>gradle clean connectedCheck</code> I got the following error: <code>Test running failed: Instrumentation run failed due to 'java.lang.IncompatibleClassChangeError'</code>
  It is reproduced on Android 5.x devices, but on 4.x no errors happen.
  But if I try to run separate tests package, suite, class or certain test in Android Studio, tests are going well.</p>
  
  <p>I don't understand why. I need to execute tests from terminal</p>
  
  <p>build.gradle file:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 18
      buildToolsVersion "22.0.1"
  
      defaultConfig {
          applicationId "com.xxx.yyy"
          minSdkVersion 9
          targetSdkVersion 18
  
          testApplicationId "com.xxx.zzz.tests"
          testInstrumentationRunner "android.test.InstrumentationTestRunner"
      }
  
      packagingOptions {
          exclude 'META-INF/LICENSE.txt'
          exclude 'META-INF/NOTICE.txt'
          exclude 'META-INF/DEPENDENCIES'
          exclude 'META-INF/LICENSE'
          exclude 'META-INF/NOTICE'
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
          }
      }
      sourceSets {
          main {
              jniLibs.srcDirs = ['libs']
          }
      }
  }
  
  repositories {
      mavenLocal()
  
      jcenter()
      mavenCentral()
  }
  
  android {
      lintOptions {
          abortOnError false
      }
  }
  
  dependencies {
      testCompile 'junit:junit:4.12'
  
      compile fileTree(dir: 'libs', include: '*.jar')
  }
  </code></pre>
  
  <p>Do anybody have any suggestions?</p>