unit testing - Android: Test running failed: Instrumentation run failed due to 'java.lang.IncompatibleClassChangeError' -


i have projects several unit tests. when try execute tests in android studio or terminal using gradle clean connectedcheck got following error: test running failed: instrumentation run failed due 'java.lang.incompatibleclasschangeerror' reproduced on android 5.x devices, on 4.x no errors happen. if try run separate tests package, suite, class or test in android studio, tests going well.

i don't understand why. need execute tests terminal

build.gradle file:

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') } 

do have suggestions?

it depends on libs including. in case, had problem when included espresso.contrib library.

you try doing though.https://stackoverflow.com/a/29423456/5280584


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -