android - 合并 dex 文件时出错

标签 android android-studio android-gradle-plugin 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,安装稳定版,重新安装 Canary 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

是否有系统的方法来定位问题的根源

最佳答案

感谢@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'
}

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

关于android - 合并 dex 文件时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47848596/

相关文章:

android - android :contentDescription ="@null" and tools:ignore ="ContentDescription"?有什么区别使用android :importantForAccessibility ="no"?

java - 将图像插入sql server并检索它

android-studio - 如何解决: 'com.xxx.xxxx.MainActivity'不能少分配给 'android.app.Activity'

android - java.util.zip.ZipException : duplicate entry

android - gradle 项目同步在 Android studio 3.0.1 中失败

java - 为什么 UI 线程被阻塞?

java - 如何从字符串实例化 Uri?

Android studio 无法打开监视器(DDMS)

gradle - 上载所有带有crashlytics的productFlavors

Android 对端未通过身份验证