Conversion to Dalvik format failed: Unable to execute dex: null

本文介绍了在Eclipse中遇到内存溢出问题时的解决方法,包括调整eclipse.ini文件中的Xms和Xmx参数来增加分配给Eclipse的内存,并提供了一种使用用户库的方法来避免第三方jar文件导致的问题。

在eclipse中编译android project,提示如标题的错误。

其原因有可能是eclipse heap overflow

解决办法:修改eclipse.ini中的Xms和Xmx

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms256m
-Xmx768m


 注意值不能改太大,不然在launch eclipse的时候会出现“Failed to create Java Virtual Machine”

 

And here are some tips from websites abroad:

As Android developer, I have met a strange problem when I want use a third party jar, it remained me that:
Dex Loader] Unable to execute dex: null
Conversion to Dalvik format failed: Unable to execute dex: null
out of memory error…An internal error occurred during: “Build Project”.
Java heap space

This is the DEX Error,I find the solutions by Google, one way is to modify the eclipse.ini, you can increase the memory allocated in eclipse.ini to this: -Xms128m -Xmx512m or something higher, but this didn’t work for me. After modify the eclipse.ini, I cannot start the eclipse. By StackOverflow, I find a solution:

eclipse.ini file must have -vm on first line and path on second line. don’t try to put everything into one line!
-vm
C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe

After add the -vm and the path in my eclipse.ini, I can start my Eclipse and the problem has been resolved.

Another way to solve the ” Conversion to Dalvik format failed: Unable to execute dex: null” problem is using the user library, the concrete steps are as follows :

  1. Right-click the project in Eclipse and select “Build Path -> Add Libraries…”.
  2. Select User Library from the list and click Next.
  3. Click the “User Libraries…” button.
  4. Click “New…” in the User Libraries dialog.
  5. Give the user library a name and select the System library checkbox and click OK.
  6. Highlight the newly added user library in the list and click the “Add JARs…” button and add the desired jar files.
  7. Click OK on the User Libraries dialog.
  8. Make sure the new user library is checked in the Add Library dialog and …
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值