UNCERTAIN TOP-LEVEL EXCLUSION: com.android.dex.DexException

I am trying to integrate barcodefraglibv2 into my Android application in AndroidStudio. I tried to copy the libs core.jar and barcodelib.jar files to the libs directory. However, when I try to start the application, I get the 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 could not solve this problem.

+7
java android android-studio dex zxing
source share
4 answers

solvable

I deleted the libraries, reloaded the project, added the libraries, deleted the support links-v4, deleted the libraries again, the assembly, the addition of the libraries, the assembly, the addition of backlinks and the assembly.

+3
source share

You have multiple copies of classes in zxing in your application. You should probably have exactly one copy: core .jar in libs/ and nothing else.

+4
source share

I removed from the / libs folder and cleaned and rebuilt it again. The problem is fixed.

 GoogleAdMobAdsSdk-6.4.1 android-support-v4 
+2
source share
  • Clean Project
  • Rebuild Project
  • Run
0
source share

All Articles