jxs1211 / android-test-kit

Automatically exported from code.google.com/p/android-test-kit
0 stars 0 forks source link

Having Guava and espresso-web as androidTest dependencies does not compile #166

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The espresso-web:2.2 release contains some classes from Guava. This makes it 
impossible to have espresso-web:2.2 and Guava as dependency for Android tests.

*What steps will reproduce the problem?*
1. Create a new Android project in AndroidStudio
2. Add espresso-web and Guava (or any other library that transitively depends 
on Guava) as dependencies for testing (see attached build.gradle)
3. Build the connectedAndroidTest target

*What is the expected output?*

I expect that the build succeeds and starts the tests

*What do you see instead?*

The build fails with an exception:

{{{
:app:dexDebugAndroidTest
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define 
Lcom/google/thirdparty/publicsuffix/PublicSuffixPatterns;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
    at com.android.dx.command.dexer.Main.run(Main.java:246)
    at com.android.dx.command.dexer.Main.main(Main.java:215)
    at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':app:dexDebugAndroidTest'.
> com.android.ide.common.process.ProcessException: 
org.gradle.process.internal.ExecException: Process 'command 
'/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java'' 
finished with non-zero exit value 2
}}}

*What version of the product are you using? On what operating system?*

Espresso 2.2, Guava 18.0 with AndroidStudio 1.2.2 on MacOS 10.10.4

Original issue reported on code.google.com by tim.haus...@grandcentrix.net on 13 Jul 2015 at 9:56

Attachments: