I
I
Igor2013-11-25 21:28:45
Android
Igor, 2013-11-25 21:28:45

How to deal with the Unable to execute DX problem?

I'm trying to compile a cocos2d-x project for android and the following error pops up:

Android Dex: [proj.android] Unable to execute DX
Android Dex: [proj.android] java.nio.BufferOverflowException
Android Dex: [proj.android] at java.nio.HeapByteBuffer.putShort(HeapByteBuffer.java:296)
Android Dex: [proj.android] at com.android.dex.Dex$Section.writeShort(Dex.java:818)
Android Dex: [proj.android] at com.android.dex.Dex$Section.writeTypeList(Dex.java:870)
Android Dex: [proj.android] at com.android.dx.merge.DexMerger$3.write(DexMerger.java:437)
Android Dex: [proj.android] at com.android.dx.merge.DexMerger$3.write(DexMerger.java:423)
Android Dex: [proj.android] at com.android.dx.merge.DexMerger$IdMerger.mergeUnsorted(DexMerger.java:317)
Android Dex: [proj.android] at com.android.dx.merge.DexMerger.mergeTypeLists(DexMerger.java:423)
Android Dex: [proj.android] at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:163)
Android Dex: [proj.android] at com.android.dx.merge.DexMerger.merge(DexMerger.java:187)
Android Dex: [proj.android] at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
Android Dex: [proj.android] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
Android Dex: [proj.android] at com.android.dx.command.dexer.Main.run(Main.java:230)
Android Dex: [proj.android] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Android Dex: [proj.android] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Android Dex: [proj.android] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Android Dex: [proj.android] at java.lang.reflect.Method.invoke(Method.java:597)
Android Dex: [proj.android] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:161)
Android Dex: [proj.android] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:294)
Android Dex: [proj.android] at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)

I have experience in developing ordinary applications for Android, where such a problem was resolved by searching for connected jar files with the same names, for example, support-v4.
Is there any universal algorithm for determining the "place" of an error? How can I find out which files are in conflict?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2013-11-26
@asdf999

I figured out that if you put the version in the project properties 4.4, then there is no annotations.jar conflict and everything compiles.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question