错误:程序类型已经存在:androidx.annotation.AnyRes

时间:2018-10-31 10:03:57

标签: androidx

在升级androidX包后遇到的问题编译通过运行是报错错误如下

AGPBI:{“种类”:“错误”,“文本”:“程序类型已存在:androidx.annotation.AnyRes”,“源”:[{}],“工具”:“ D8”} :app:transformDexArchiveWithExternalLibsDexMergerForDebug失败 失败:构建失败,发生异常。 * 什么地方出了错: 任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug'的执行失败。

  

com.android.builder.dexing.DexArchiveMergerException:合并dex归档文件时出错:/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/0.jar,/ home / gx /Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/1.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/2.jar, /home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/3.jar,/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/ 4.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 5.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 6.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 7.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 8.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 9.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 10.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 11.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 12.jar,/ home / gx /文档/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/13.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/14.jar、/主页/ gx /文档/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/15.jar,/home/gx/Docume nts / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 16.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 17.jar,/主页/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/18.jar,/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/19 .jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 20.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder /debug/21.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/22.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates /transforms/dexBuilder/debug/23.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/ build / intermediates / transforms / dexBuilder / debug / 24.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 25.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 26.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 27.jar,/ home / gx /文档/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/28.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/29.jar、/主页/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/30.jar,/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/31 .jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 32.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 33.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 34.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 35.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build /中间体/transforms/dexBuilder/debug/36.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/37.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/ app / build / intermediates / transforms / dexBuilder / debug / 38.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 39.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 40.jar,/ home / gx / Documents / AndroidDeveloperProje cts / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 41.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 42.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 43.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 44.jar ,/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/45.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug /46.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/47.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms /dexBuilder/debug/48.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/trans表格/dexBuilder/debug/49.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/build/intermediates/transforms/dexBuilder/debug/55.jar、/home/gx/Documents/AndroidDeveloperProjects/AndroidModuler/app/ build / intermediates / transforms / dexBuilder / debug / 58.jar,/ home / gx / Documents / AndroidDeveloperProjects / AndroidModuler / app / build / intermediates / transforms / dexBuilder / debug / 61.jar     在https://developer.android.com/studio/build/dependencies#duplicate_classes了解如何解决该问题。     程序类型已经存在:androidx.annotation.AnyRes

1 个答案:

答案 0 :(得分:0)

删除vectorDrawables.useSupportLibrary = true即可