Android - Failed to convert to Dalvik format: unable to execute dex: Java heap space

When I try to run my project on my Android device, I get the error message "Conversion to Dalvik format failed: Unable to execute dex: Java heap space" . I imported the project from another computer, where it worked correctly.

I was in Failed to convert the Dalvik format: failed to execute dex: Java heap space and tried to increase -XmsAm and -XmxBm , but as the values ​​increase, the problems continue until Eclipse starts up, or I get an error message: "Dex Loader] Unable to execute dex: Cannot handle conversion to jumbo index!"

Does anyone know alternative solutions?

Edit: I tried to create a new project and copy / paste all the files from the imported project and now get a new error. When I run it, I get the error: "Installation error: INSTALL_FAILED_DEXOPT"

Logcat says the following:

 11-08 15:14:31.317: E/dalvikvm(3041): ERROR: Can't byte swap: bad dex version (0x30 33 36 00) 11-08 15:14:31.317: E/dalvikvm(3041): ERROR: Byte swap + verify failed 11-08 15:14:31.317: E/dalvikvm(3041): Optimization failed 11-08 15:14:31.325: E/installd(1059): dexopt failed on '/data/dalvik-cache/ data@app @ vmdl28652.tmp@classes.dex ' res = 65280 11-08 15:14:33.083: E/AndroidRuntime(3035): ERROR: thread attach failed 

Is anyone perhaps familiar with this error or should open a new thread for it?

+4
source share
3 answers

This can be solved by increasing the heap memory size for dx.jar located in your Android SDK.

You can do this by editing the dx.bat adt-bundle-windows-x86_64-20130729\adt-bundle-windows-x86_64-20130729\sdk\build-tools\android-4.3\dex.bat and updating its value set defaultXmx=-Xmx1024M to set defaultXmx=-Xmx1624M

0
source

I had this with Admob ext. JAR. They have a new google library and an old SDK. I checked, and although I swear I deleted it, the old external JAR was still there. Removing the old JAR worked for me. In Eclipse I:

Right-click on the project and go to properties, click on the Java build path, then libraries, then click on the admob option in the list and click "Delete."

If you click on android instead of the java build path, you will see a google play services project appearing in the library, with a field in which there were no links.

0
source

Try right-clicking in the project name> source> Clear ... Hope this works for you.

-1
source

Source: https://habr.com/ru/post/1380113/


All Articles