Dex merger problem on testcoverage with 2 modules.

155 views
Skip to first unread message

Niek Pulles

unread,
Oct 13, 2015, 4:11:00 AM10/13/15
to adt-dev
Hi,

Any has any clue why I receive the following error on transformClassesWithDexForDailyDebug:

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/vladium/emma/rt/RT;
        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:502)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
        at com.android.dx.command.dexer.Main.run(Main.java:277)
        at com.android.dx.command.dexer.Main.main(Main.java:245)
        at com.android.dx.command.Main.main(Main.java:106)

We have 2 modules in Android studio, both have: "testCoverageEnabled true". 
1st module is sdk, 2nd module is app. Both have unit tests.

So module 1 is include in module 2. When I remove "testCoverageEnable true" in any of the modules it's working fine, but then I don't have any testCoverage reports for either module.

sdk gradle file: http://pastebin.com/JHYiTP5e 
app gradle file: http://pastebin.com/nG2KXjaG

It looks like it does merge the sdk module in the app module with both having jacoco, seems like to work for all other dependencies (which are duplicated in both gradle files).

Thanks in advanced.
Niek

Niek Pulles

unread,
Oct 13, 2015, 4:16:34 AM10/13/15
to adt-dev
Forgot to mention, it's with: com.android.tools.build:gradle:1.4.0-beta6 and not happening with 1.3.0, all other beta versions of 1.4.0 have other issues which make it not compilable and solved in beta6.

Riccardo Ciovati

unread,
Oct 13, 2015, 5:24:58 AM10/13/15
to adt-dev
Il giorno martedì 13 ottobre 2015 10:16:34 UTC+2, Niek Pulles ha scritto:
Forgot to mention, it's with: com.android.tools.build:gradle:1.4.0-beta6 and not happening with 1.3.0, all other beta versions of 1.4.0 have other issues which make it not compilable and solved in beta6.

I'm getting this error too running tests for a library project with plugin 1.4.0-beta6. With plugin version 1.4.0-beta3 is working fine.

Xavier Ducrohet

unread,
Oct 13, 2015, 4:40:27 PM10/13/15
to adt...@googlegroups.com
thanks for the report. I'll take a look at it right now.

--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

Niek Pulles

unread,
Oct 27, 2015, 9:22:53 AM10/27/15
to adt-dev
Xavier

I didn't have the time to create an example project, hopefully you have had some luck?

--
Kind regard,
Niek

Niek Pulles

unread,
Nov 9, 2015, 7:26:03 AM11/9/15
to adt-dev
Xavier,

1.5.0-beta2 is working fine for me, compiling and unit test pass.

Thanks.
Reply all
Reply to author
Forward
0 new messages