Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
239 views
in Technique[技术] by (71.8m points)

android - Conversion to Dalvik format failed: Unable to execute dex: Java heap space

I have added a 2.45mb jar file to my Android eclipse project and now I continue to get "Conversion to Dalvik format failed: Unable to execute dex: Java heap space" no matter what I do.

I have researched online, and was informed to update my eclipse.ini to increase my Java VM heapsizes. I have done this for all the values in eclipse.ini and I continue to get the build error.

Any ideas?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Modify the -XmsAm and -XmxBm paremeters in eclipse.ini so that they are large enough. The default is -Xms40m -Xmx384m. Try changing them both to -Xms512m -Xmx512m and restart eclipse to see if that helps. If not, continue to increase the values and restart eclipse until either one of two things happens:

  1. Your build completes.
  2. Eclipse won't restart because you don't have enough memory.

eclipse.ini is located at /etc/eclipse.ini in Ubuntu (assuming you installed Eclipse from the Ubuntu repositories).

For MAC please see:

Finding eclipse.ini is a wee bit tricky. To locate it, right-click on the Eclipse Application icon and select "Show Package Contents", then double-click on the "Contents" folder and then double-click on the "MacOS" folder, the home of eclipse.ini

https://confluence.sakaiproject.org/pages/viewpage.action?pageId=61341742


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...