合并dex存档时出错

时间:2017-12-16 18:08:44

标签: android android-studio android-gradle kotlin

我正在使用Kotlin和Android Studio构建一个小型Android应用。一切都很好,但突然之间(至少在我看来),我坚持

Error:Execution failed for task :bahndb:transformDexArchiveWithExternalLibsDexMergerForDebugAndroidTest'.
> com.android.builder.dexing.DexArchiveMergerException: 
Error while merging dex archives: 
C:\Users\Dieter\AndroidStudioProjects\zuegliwidget\bahndb\build\intermediates\transforms\dexBuilder\androidTest\debug\13.jar,

等等到47.jar,当我尝试运行仪器化测试时。本地测试一切正常。奇怪的是,即使之前有效的早期检查显示出这种行为(一些更新?我重新安装了Android Studio两次)

我已经在这里阅读了关于这个主题的所有信息,没有人帮忙:

  • 使用干净的构建(我每次都这样做)
  • 无效缓存(一遍又一遍)
  • 添加了multiDex
  • 尝试了不同的Kotlin插件
  • 卸载3.1 Canary 5,安装稳定,重新安装金丝雀5
  • 一个接一个地取消/评论依赖项(之前已经有效) 运行Lint,但失败并显示错误

App有2个子模块,bahndb和http。以下是gradle文件,如果重要的话

https://github.com/dmenne/zuegliwidget/blob/master/build.gradle

https://github.com/dmenne/zuegliwidget/blob/master/app/build.gradle

https://github.com/dmenne/zuegliwidget/blob/master/bahndb/build.gradle<<最可能是内疚

https://github.com/dmenne/zuegliwidget/blob/master/http/build.gradle

是否有系统的方法来找到问题的根源

1 个答案:

答案 0 :(得分:2)

感谢@ CommonsWare的评论,我发现我有

implementation ('com.squareup.retrofit2:converter-simplexml:2.3.0'){
    exclude group: 'xpp3', module: 'xpp3'
    exclude group: 'stax', module: 'stax-api'
    exclude group: 'stax', module: 'stax'
}

在一个子模块中,但忘记了另一个子模块中的排除部分。