android - Espresso test aren't running after adding espresso-contrib library in gradle -
when i'm adding
androidtestcompile 'com.android.support.test.espresso:espresso-contrib:2.2.1'
in gradle , run espresso test, following error:
testing started @ 5:59 pm ... 02/08 17:59:58: launching changetext_sameact...() no apk changes detected since last installation, skipping installation of /users/xxx/documents/home/masterdetails/app/build/outputs/apk/app-debug.apk $ adb shell force-stop databinding.com.masterdetails no apk changes detected since last installation, skipping installation of /users/xxx/documents/home/masterdetails/app/build/outputs/apk/app-debug-androidtest-unaligned.apk $ adb shell force-stop databinding.com.masterdetails.test running tests $ adb shell instrument -w -r -e debug false -e class databinding.com.masterdetails.testpostlistactivity#changetext_sameactivity databinding.com.masterdetails.test/android.support.test.runner.androidjunitrunner client not ready yet..waiting process come online connected process 10355 on device samsung-sm_g920f-01157df1bc4b5336 test running started java.lang.incompatibleclasschangeerror: databinding.com.masterdetails.postlistactivity @ dalvik.system.dexfile.defineclassnative(native method) @ dalvik.system.dexfile.defineclass(dexfile.java:226) @ dalvik.system.dexfile.loadclassbinaryname(dexfile.java:219) @ dalvik.system.dexpathlist.findclass(dexpathlist.java:321) @ dalvik.system.basedexclassloader.findclass(basedexclassloader.java:54) @ java.lang.classloader.loadclass(classloader.java:511) @ java.lang.classloader.loadclass(classloader.java:469) @ databinding.com.masterdetails.testpostlistactivity.<init>(testpostlistactivity.java:25) @ java.lang.reflect.constructor.newinstance(native method) @ java.lang.reflect.constructor.newinstance(constructor.java:288) @ org.junit.runners.blockjunit4classrunner.createtest(blockjunit4classrunner.java:217) @ org.junit.runners.blockjunit4classrunner$1.runreflectivecall(blockjunit4classrunner.java:266) @ org.junit.internal.runners.model.reflectivecallable.run(reflectivecallable.java:12) @ org.junit.runners.blockjunit4classrunner.methodblock(blockjunit4classrunner.java:263) @ org.junit.runners.blockjunit4classrunner.runchild(blockjunit4classrunner.java:78) @ org.junit.runners.blockjunit4classrunner.runchild(blockjunit4classrunner.java:57) @ org.junit.runners.parentrunner$3.run(parentrunner.java:290) @ org.junit.runners.parentrunner$1.schedule(parentrunner.java:71) @ org.junit.runners.parentrunner.runchildren(parentrunner.java:288) @ org.junit.runners.parentrunner.access$000(parentrunner.java:58) @ org.junit.runners.parentrunner$2.evaluate(parentrunner.java:268) @ org.junit.runners.parentrunner.run(parentrunner.java:363) @ org.junit.runners.suite.runchild(suite.java:128) @ org.junit.runners.suite.runchild(suite.java:27) @ org.junit.runners.parentrunner$3.run(parentrunner.java:290) @ org.junit.runners.parentrunner$1.schedule(parentrunner.java:71) @ org.junit.runners.parentrunner.runchildren(parentrunner.java:288) @ org.junit.runners.parentrunner.access$000(parentrunner.java:58) @ org.junit.runners.parentrunner$2.evaluate(parentrunner.java:268) @ org.junit.runners.parentrunner.run(parentrunner.java:363) @ org.junit.runner.junitcore.run(junitcore.java:137) @ org.junit.runner.junitcore.run(junitcore.java:115) @ android.support.test.internal.runner.testexecutor.execute(testexecutor.java:54) @ android.support.test.runner.androidjunitrunner.onstart(androidjunitrunner.java:240) @ android.app.instrumentation$instrumentationthread.run(instrumentation.java:1889) tests ran completion.
and tests aren't running. suspect gradle problem here app gradle file:
apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.2" databinding { enabled = true } defaultconfig { applicationid "databinding.com.masterdetails" minsdkversion 18 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' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:recyclerview-v7:23.1.1' compile 'com.android.support:design:23.1.1' androidtestcompile 'com.android.support:support-annotations:23.1.1' // android junit runner androidtestcompile 'com.android.support.test:runner:0.4.1' // junit4 rules androidtestcompile 'com.android.support.test:rules:0.4.1' // espresso core androidtestcompile 'com.android.support.test.espresso:espresso-core:2.2.1' // espresso-contrib datepicker, recyclerview, drawer actions, accessibility checks, countingidlingresource androidtestcompile 'com.android.support.test.espresso:espresso-contrib:2.2.1' androidtestcompile 'com.android.support.test.espresso:espresso-idling-resource:2.2.1' }
i need add
androidtestcompile 'com.android.support.test.espresso:espresso-contrib:2.2.1'
so can test recyclerview.
please check dependendecies, espresso
ones.
dependencies { compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' androidtestcompile "com.android.support:support-annotations:$asversion" androidtestcompile 'com.android.support.test.espresso:espresso-core:2.2.1' androidtestcompile 'com.android.support.test.espresso:espresso-intents:2.2.1' androidtestcompile('com.android.support.test.espresso:espresso-contrib:2.2.1') { exclude group: 'com.android.support', module: 'appcompat' exclude group: 'com.android.support', module: 'support-v4' exclude module: 'recyclerview-v7' } androidtestcompile 'com.android.support.test:runner:0.4.1' compile 'com.squareup.retrofit:retrofit:1.9.0' compile "com.android.support:appcompat-v7:$asversion" compile "com.android.support:support-v4:$asversion" compile "com.android.support:design:$asversion"
}
where def asversion = '23.1.1'
maybe missed something. mine working
hope help
Comments
Post a Comment