4

When I try to run my project on my android device I get the error "Conversion to Dalvik format failed: Unable to execute dex: Java heap space". I have imported the project from another computer where it was working properly.

I have been to Conversion to Dalvik format failed: Unable to execute dex: Java heap space and tried increasing the -XmsAm and -XmxBm but as I increase the values the problem continues until Eclipse won't start or I get an error that says: "Dex Loader] Unable to execute dex: Cannot handle conversion to jumbo index!"

Does anyone know any alternate solutions?

Edit: I tried making a new project and copy/pasting all the files over from the imported project and now have a new error. When I run it I get the error: "Installation error: INSTALL_FAILED_DEXOPT"

Logcat says this:

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 I open a new thread for it?

Community
  • 1
  • 1
Bryan
  • 623
  • 1
  • 6
  • 23
  • Does your project include some third party .jar files? And was is and android project not the other computer too? – D-Dᴙum Nov 08 '11 at 21:47
  • It does, but no longer uses them. I removed them from the build path and from the new laptop and am now getting an additional UID error in logcat: 11-09 11:27:01.380: E/PackageManager(1280): Package com.android.Project has mismatched uid: 10073 on disk, 10089 in settings – Bryan Nov 09 '11 at 15:34
  • Did you copy the project directory or just the source files? If you copied the directory you may have copied files relevant to configuration on the old computer. I'd make a fresh project on your new computer and copy the source only. – D-Dᴙum Nov 10 '11 at 10:13
  • I did copy the project over directly first. I just now started a fresh project, copied the AndroidManifest.xml contents over, some strings and images, and then ran the project with the default activity class and am now getting this error: # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (classFileParser.cpp:3470), pid=4980, tid=2944 # Error: ShouldNotReachHere() # JRE version: 7.0_01-b08 # Java VM: Java HotSpot(TM) Client VM (21.1-b02 mixed mode windows-x86 ) # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows – Bryan Nov 10 '11 at 15:47
  • I'd copy JUST the source. Re-start everything else from scratch. It's a pain I know. – D-Dᴙum Nov 10 '11 at 23:40
  • have you tried updating the ADT&SDK , and JDK 1.6 ? also, check that a totally new project (hello world) can compile & run. – android developer Jun 01 '13 at 13:02
  • @PeterO. The OP has indicated in the post that they have looked at the question you deem duplicate, but the problem there has not worked for them. – mydoghasworms Jan 13 '14 at 12:18

3 Answers3

0

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

This is can be done by editing the dx.bat file adt-bundle-windows-x86_64-20130729\adt-bundle-windows-x86_64-20130729\sdk\build-tools\android-4.3\dex.bat and update its set defaultXmx=-Xmx1024M value to set defaultXmx=-Xmx1624M

NREZ
  • 942
  • 9
  • 13
0

I had this with Admob ext. JAR. They have the new google library and the old SDK. I checked and even though I swear I removed 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 into properties, click on java build path, then libraries, then click on the admob option in the list and click remove.

If you click on android instead of java build path you should see the google play services project appearing under library with the box unticked.

John Ashmore
  • 1,015
  • 1
  • 10
  • 25
-1

Try right click in the project name > source > Clean up... I hope it work for you.

gustavotbb
  • 1
  • 1
  • 2