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

由 于最近在做移植,要用到一些库,但出现Conversion to Dalvik format failed: Unable to execute dex: null这个问题,build工程目录时常出现内存不足,然后eclipse就挂掉,在eclipse.ini提高内存,eclipse又运行不了,搜索 到这个

终于问题解决了。



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 …

Posted by CuteAndroid



资料:http://www.cuteandroid.com/tips-for-android-developer-conversion-to-dalvik-format-failed-unable-to-execute-dex-null

在kmail里的.classpath中有这么两句:

 <classpathentry excluding="**/.svn/**|.svn/**" kind="src" path="src"/>
 <classpathentry excluding="**/.svn/**|.svn/**" kind="src" path="gen"/>

把这两句干掉,就可以正常运行了。

“the resource is not on the build path of a XXX project”问题解决办法

今天自己从svn上下了个项目,想研读一下代码。却发现代码链接不好使了,会弹出一个对话框说:“the resource is not on the build path of a XXX project”。这么有代码跳转读个陌生项目岂不累死……
网上简单找了一下,没找到。于是自己就凭感觉试了一下,结果出来了……就记录、分享一下吧!
一句话,把你项目从新做为新项目检出一遍就好了。(作为新项目检出时,需要原来svn版本中没有该项目的“.project”文件,有的话无法作为新项目检出。删掉就好!)
请教了带头大哥:右键检出的项目,-->Properties-->Java Build Path-->Source-->删掉原有的src,在Add Folder中添加新的src-->在Libaries中添加项目使用的所有jar包。
之后就可以了。
原文地址:https://www.cnblogs.com/KiloNet/p/1942275.html