android - Multiple dex files define Landroid/support/test/espresso/contrib/DrawerActions -
this question has answer here:
when trying migrate espresso 2.1 hit following road-block
com.android.dex.dexexception: multiple dex files define landroid/support/test/espresso/contrib/draweractions$1; @ com.android.dx.merge.dexmerger.readsortabletypes(dexmerger.java:596) @ com.android.dx.merge.dexmerger.getsortedtypes(dexmerger.java:554) @ com.android.dx.merge.dexmerger.mergeclassdefs(dexmerger.java:535) @ com.android.dx.merge.dexmerger.mergedexes(dexmerger.java:171) @ com.android.dx.merge.dexmerger.merge(dexmerger.java:189) @ com.android.dx.command.dexer.main.mergelibrarydexbuffers(main.java:454) @ com.android.dx.command.dexer.main.runmonodex(main.java:303) @ com.android.dx.command.dexer.main.run(main.java:246) @ com.android.dx.command.dexer.main.main(main.java:215) @ com.android.dx.command.main.main(main.java:106)
but see 1 source this:
androidtestcompile 'com.android.support.test.espresso:espresso-contrib:2.1'
any hint on how solve this? dependency tree:
androidtestcompile - classpath compiling androidtest sources. +--- com.android.support.test:runner:0.2 | +--- junit:junit-dep:4.10 | | \--- org.hamcrest:hamcrest-core:1.1 -> 1.3 | +--- com.android.support.test:exposed-instrumentation-api-publish:0.2 | \--- com.android.support:support-annotations:22.0.0 +--- com.android.support.test:rules:0.2 | \--- com.android.support.test:runner:0.2 (*) +--- com.android.support.test.espresso:espresso-contrib:2.1 | +--- com.android.support:recyclerview-v7:22.0.0 | | +--- com.android.support:support-v4:22.0.0 | | | \--- com.android.support:support-annotations:22.0.0 | | \--- com.android.support:support-annotations:22.0.0 | +--- com.android.support:support-v4:22.0.0 (*) | \--- com.android.support.test.espresso:espresso-core:2.1 | +--- com.android.support.test:rules:0.2 (*) | +--- com.squareup:javawriter:2.1.1 | +--- org.hamcrest:hamcrest-integration:1.1 | | \--- org.hamcrest:hamcrest-core:1.1 -> 1.3 | +--- com.android.support.test.espresso:espresso-idling-resource:2.1 | +--- org.hamcrest:hamcrest-library:1.1 | | \--- org.hamcrest:hamcrest-core:1.1 -> 1.3 | +--- javax.inject:javax.inject:1 | +--- com.google.code.findbugs:jsr305:2.0.1 | +--- com.android.support.test:runner:0.2 (*) | +--- javax.annotation:javax.annotation-api:1.2 | \--- org.hamcrest:hamcrest-core:1.1 -> 1.3 +--- info.cukes:cucumber-java:1.2.0 | \--- info.cukes:cucumber-core:1.2.0 | +--- info.cukes:cucumber-html:0.2.3 | +--- info.cukes:cucumber-jvm-deps:1.0.3 | \--- info.cukes:gherkin:2.12.2 +--- info.cukes:cucumber-android:1.2.0 +--- com.google.dexmaker:dexmaker-mockito:1.0 | \--- org.mockito:mockito-core:1.9.5 | \--- org.objenesis:objenesis:1.0 +--- org.assertj:assertj-core:1.7.1-targetfix +--- com.uphyca:android-junit4:0.5 \--- junit:junit:4.11 \--- org.hamcrest:hamcrest-core:1.3
small world ;)
this dexexception of multiple dex files caused indirectly espresso-contrib:2.1, real root cause com.android.support.test:runner:0.2, has other sub-dependencies.
removing test:runner works me.
while there post saying it's because of com.android.support:support-v4, in case, it's 22.0.0 test, , maybe app module using different version. tried do:
androidtestcompile ('com.android.support.test.espresso:espresso-contrib:2.1') { exclude group: 'com.android.support', module: 'support-v4' exclude module: 'support-annotations' }
but doesn't work @ all.
Comments
Post a Comment