[ Dex Loader] Unable to execute dex: java.lang.AssertionError. Check the Eclipse log for stack trace.

Conversion to Dalvik format failed: Unable to execute dex: java.lang.AssertionError. Check the Eclipse log for stack trace.

最近编译Android工程安装失败,网上说应该是jar包数量太多导致无法安装

以下是几种处理方法:

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 orsomething 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 userlibrary, 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 checkboxand click OK.(一定要选中添加的system lib)

[置顶] Android [Dex Loader] Unable to execute dex:_第1张图片
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 …


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

根据以上总结我选用add user lib的形式

那到底为什么呢?我很是疑惑,几种添加的jar包的形式到底有什么不一样?

根据eclipse官方解释


Libraries tab options:
Option Description
Add JARs Allows you to navigate the workbench hierarchy and select JAR files to add to the build path.
Add External JARs Allows you to navigate the file system (outside the workbench) and select JAR files to add to the build path.
Add Variable Allows you to add classpath variables to the build path. Classpath variables are an indirection to JARs with the benefit of avoiding local file system paths in a classpath. This is needed when projects are shared in a team.
Variables can be created and edited in the Java > Build Path > Classpath Variables preference page.
Add Library Allows to add a predefined libraries like the JRE System Library. Such libraries can stand for an arbitrary number of entries (visible as children node of the library node)
Add Class Folder Allows to navigate the workbench hierarchy and select a class folder for the build path. The selection dialog also allows you to create a new folder.
Add External Class Folder Allows to navigate the file system (outside the workbench) and select a class folder for the build path. The selection dialog also allows you to create a new folder.
Edit Allows you to modify the currently selected library entry or entry attribute
Remove Removes the selected element from the build path. This does not delete the resource.
Migrate JAR File Migrate a JAR on the build path to a newer version. If the newer version contains refactoring scripts the refactoring stored in the script will be executed.

摘自http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/ref-properties-build-path.htm

也就是说选中system lib的形式可以任意的添加jar的数量



更多相关文章

  1. [置顶] android调用系统相机拍照并保存在本地
  2. [置顶] Android AsyncTask异步的学习
  3. [置顶] Android技术交流群
  4. [置顶] android软键盘的隐藏问题
  5. [置顶] TextView属性大全
  6. [置顶] Android 实现对话框圆角功能
  7. [置顶] android 进程的优先级
  8. [置顶] Android 从硬件到应用:一步一步向上爬 1 -- 从零编写底层
  9. [置顶] Android实训课程之三 这次课老师先是提到了Android有四大

随机推荐

  1. Android(安卓)Hook Java
  2. Android中使用嵌入式关系型SQLite数据库
  3. Android(安卓)监控程序安装和删除的实现
  4. android--系统jar包引用
  5. 我的翻译:Saving Files
  6. React Native和Android整合详解
  7. Android之traceview使用
  8. Android圆角bug
  9. Android(安卓)之 使用嵌入式关系型SQLite
  10. Android(安卓)系统启动