我正在我的构建上设置espresso,这很好,除了我每次运行测试之前需要清理项目或者我得到以下错误。这可能是一个多指针问题。只是想知道是否有关于如何避免此错误而不首先清理的建议,因为它确实减慢了修复和放大跑步。
Unknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : com.android.dex.DexException: Multiple dex files define Landroid/app/BuildConfig;
Unknown source file : at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
Unknown source file : at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
Unknown source file : at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
Unknown source file : at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
Unknown source file : at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
Unknown source file : at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
Unknown source file : at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
Unknown source file : at com.android.dx.command.dexer.Main.run(Main.java:246)
Unknown source file : at com.android.dx.command.dexer.Main.main(Main.java:215)
Unknown source file : at com.android.dx.command.Main.main(Main.java:106)
答案 0 :(得分:0)
不是真的修复,但我设法通过删除app / build / intermediates / dex文件夹来解决这个问题。然后我不需要在每次更改后清理。