迁移到AndroidX后,由于迁移,我遇到以下问题:
失败:构建失败,并出现异常。
com.android.builder.dexing.DexArchiveMergerException:合并dex归档文件时出错:/home/lexy/AndroidStudioProjects/Testbucks/app/build/intermediates/transforms/dexBuilder/debug/0.jar、/home/lexy/AndroidStudioProjects /Testbucks/app/build/intermediates/transforms/dexBuilder/debug/1.jar、/home/lexy/AndroidStudioProjects/Testbucks/app/build/intermediates/transforms/dexBuilder/debug/2.jar、/home/lexy/AndroidStudioProjects /Testbucks/app/build/intermediates/transforms/dexBuilder/debug/3.jar、/home/lexy/AndroidStudioProjects/Testbucks/app/build/intermediates/transforms/dexBuilder/debug/4.jar、/home/lexy/AndroidStudioProjects /Testbucks/app/build/intermediates/transforms/dexBuilder/debug/5.jar、/home/lexy/AndroidStudioProjects/Testbucks/app/build/intermediates/transforms/dexBuilder/debug/6.jar、/home/lexy/AndroidStudioProjects /Testbucks/app/build/intermediates/transforms/dexBuilder/debug/7.jar,/home/lexy/AndroidStudioProjects/Testbucks/app/build/intermediates/transforms/dexBuilder/debu g / 8.jar,/ home / lexy / AndroidStudioProjects / Testbucks / app / build / intermediates / transforms / dexBuilder / debug / 9.jar,/ home / lexy / AndroidStudioProjects / Testbucks / app / build / intermediates / transforms / dexBuilder / debug / 10.jar,/ home / lexy / AndroidStudioProjects / Testbucks / app / build / intermediates / transforms / dexBuilder / debug / 11.jar,/ home / lexy / AndroidStudioProjects / Testbucks / app / build / intermediates / transforms / dexBuilder / debug / 12.jar,/ home / lexy / AndroidStudioProjects / Testbucks / app / build / intermediates / transforms / dexBuilder / debug / 13.jar,/ home / lexy / AndroidStudioProjects / Testbucks / app / build / intermediates / transforms / dexBuilder / debug / 14.jar,/ home / lexy / AndroidStudioProjects / Testbucks / app / build / intermediates / transforms / dexBuilder / debug / 15.jar ... 在https://developer.android.com/studio/build/dependencies#duplicate_classes了解如何解决该问题。 程序类型已经存在:androidx.concurrent.futures.DirectExecutor
有没有人遇到过类似的问题,因为我没有在任何论坛中找到解决此问题的任何方法。
答案 0 :(得分:8)
迁移到AndroidX后,我遇到了类似的问题,该问题是由于番石榴造成的。 我解决该问题的方法是包括以下内容:
configurations {
all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}
在(Module:app)中,大多数解决方案建议如果遇到此问题,请在模块gradle中包含以下内容:
implementation("android.arch.work:work-runtime:1.0.0-alpha09") {
exclude group: 'com.google.guava', module: 'listenablefuture'
}
这会导致以下问题:程序类型已经存在androidx.concurrent.futures.DirectExecutor。