本文介绍了意外的顶级例外:com.android.dex.DexException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想吧codefraglibv2融入我的AndroidStudio Android应用程序。我试图库core.jar添加和酒吧codelib.jar复制到libs目录。然而,当我尝试运行应用程序时,我得到以下错误
I am trying to integrate barcodefraglibv2 into my android app in AndroidStudio. I tried to copy libs core.jar and barcodelib.jar into libs directory. However when I try to run application, I get following error
Error:Execution failed for task ':Blok:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/home/backman/android/sdk/build-tools/android-4.4.2/dx --dex --output /home/backman/AndroidStudioProjects/Blok/Blok/build/dex/debug /home/backman/AndroidStudioProjects/Blok/Blok/build/classes/debug /home/backman/AndroidStudioProjects/Blok/Blok/build/dependency-cache/debug /home/backman/AndroidStudioProjects/Blok/Blok/build/pre-dexed/debug/core-bcdbe5f84dd399255abb34d14ce9def109db2534.jar
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/zxing/BarcodeFormat;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)
我有没有运气试图解决它。
I have no luck trying to solve it.
推荐答案
解决了,
我删除库,重新加载项目,添加库,打消了我的引用来支持V4,除去库再次,建立,加上库,构建,重新添加引用和建设。
I removed libraries, reload project, add libraries, removed my references to support-v4, removed libraries again, build, add libraries, build, added back references and build.
这篇关于意外的顶级例外:com.android.dex.DexException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!