简体   繁体   English

意外的顶级异常:com.android.dex.DexException

[英]UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException

I am trying to integrate barcodefraglibv2 into my android app in AndroidStudio. 我正在尝试将barcodefraglibv2集成到AndroidStudio中的Android应用程序中。 I tried to copy libs core.jar and barcodelib.jar into libs directory. 我试图将libs core.jar和barcodelib.jar复制到libs目录中。 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. 我没有运气试图解决它。

You have multiple copies of the classes in zxing in your app. 您在应用中有多个zxing类的副本。 You should likely have exactly one copy: the core .jar in libs/ and nothing else. 你可能只有一个副本: libs/core .jar,没有别的。

Solved, 解决了,

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. 我删除了库,重新加载项目,添加库,删除了对support-v4的引用,再次删除了库,构建,添加库,构建,添加了引用和构建。

I removed from /libs folder and cleaned and rebuild it again.problem fixed 我从/ libs文件夹中删除并清理并重新重建它。修复了问题

GoogleAdMobAdsSdk-6.4.1
android-support-v4
  1. Clean Project
  2. Rebuild Project
  3. Run

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 意外的顶级异常:com.android.dex.DexException:多个dex文件定义 - UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define 意外的顶级异常:com.android.dex.DexException:多个dex文件定义 - UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Android:Dex Issue(非预期的最高级别例外:) - Android: Dex Issue(UNEXPECTED TOP-LEVEL EXCEPTION:) 将字节码转换为dex:原因:com.android.dex.DexException:定义了多个dex文件 - converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define com.android.dex.DexException:多个dex文件定义了Lcom / google / android / gms / location / places / PlaceReport; - com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/location/places/PlaceReport; 错误:com.android.dex.DexException:多个dex文件定义了Ledu / umd / cs / findbugs / annotations / NonNull; - Error:com.android.dex.DexException: Multiple dex files define Ledu/umd/cs/findbugs/annotations/NonNull; com.android.dex.DexException:多个dex文件定义了Lcom / facebook / internal / Utility $ GraphMeRequestWithCacheCallback; - com.android.dex.DexException: Multiple dex files define Lcom/facebook/internal/Utility$GraphMeRequestWithCacheCallback; com.android.dex.DexException:多个dex文件定义Lorg / hamcrest / Description; - com.android.dex.DexException: Multiple dex files define Lorg/hamcrest/Description; Android Maven意外的顶级异常 - Android Maven Unexpected Top-Level Exception Android Studio:超出预期的最高级别: - Android Studio : UNEXPECTED TOP-LEVEL EXCEPTION:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM