Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException.
来源:互联网 发布:大数据imf行动 编辑:程序博客网 时间:2024/05/19 10:54
Error处理:Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException.
Error处理:Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException.
导入Eclipse Android2.X项目后运行,提示报错:
Console中提示:
通过clean up,fix project之后问题均不能解决。
网上还看到有人说,是因为Eclipse stack的问题,调整之后可以解决问题;按此提示,eclipse.ini的内容如下:
- -startup
- plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
- --launcher.library
- plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
- -product
- org.eclipse.epp.package.java.product
- --launcher.defaultAction
- openFile
- --launcher.XXMaxPermSize
- 512M
- -showsplash
- org.eclipse.platform
- --launcher.XXMaxPermSize
- 256m
- --launcher.defaultAction
- openFile
- -vmargs
- -Dosgi.requiredJavaVersion=1.5
- -Xms512m
- -Xmx1024m
重启eclipse之后,运行,问题依旧。
如何解决?
之前也遇到过代码没有错误,就是编译运行时报错的情况。之前是因为引用第三方jar造成的,引用方式不对造成的,结合目前的状况,
后来goolge上看到:http://code.google.com/p/android/issues/detail?id=20398帖子中的:
- Here is differences between old and new:
- (old)
- <?xml version="1.0" encoding="UTF-8"?>
- <classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="src" path="andengine_src"/> <!-- NOTICE THIS LINE -->
- <classpathentry kind="output" path="bin"/>
- </classpath>
- (new)
- <?xml version="1.0" encoding="UTF-8"?>
- <classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> <!-- NOTICE THIS LINE -->
- <classpathentry kind="output" path="bin/classes"/>
- </classpath>
- Also, new .project file does not contain <linkedResources> section
认为下面调整引用库的方式比较靠谱。于是根据这个思想进行调整项目的.classpath
我的.classpath文件内容如下:
- <?xml version="1.0" encoding="UTF-8"?>
- <classpath>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
- <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
- <classpathentry kind="lib" path="libs/achartengine-1.1.0.jar"/>
- <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
- <classpathentry kind="output" path="bin/classes"/>
- </classpath>
调整之后如下:
- <?xml version="1.0" encoding="UTF-8"?>
- <classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="lib" path="libs/achartengine-1.1.0.jar"/>
- <classpathentry kind="output" path="bin/classes"/>
- </classpath>
之后Refresh--->>Clean UP--->>运行项目,一切正常,至此问题解决。
----------
备注说明:
对于这个问题,发现在升级SDK Tool到22.3之后,也就是Android 4.4的SDK及工具之后,加载之前老版本的项目都会出现这个问题。
关键是要将.classpath文件中的:
- <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
· 去掉,之后clean up整个项目,再重新编译即可。
后续说明(2013年11月20日):
对于这个问题,最近大家可能比较苦恼,我也发现并不是所有的项目都会出现这个问题,对于具体差异和原因有待以后遇到再深入探究吧。
不过遇到这个问题的项目,凡是经过以下方法处理的都能够正常进行编译和运行。
1、找到你的项目
2、点击右键
3、打开Properties属性项
4、选中左边Java Build Path项,并在该选项中打开Libraries选项卡,如上图中,将Android Dependencies项和Android Private Libraries这两项Remove掉。
5、Clean up该项目
6、重新编译运行。
- Error处理:Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException.
- Error处理:Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException.
- Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException.
- Error处理:Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException
- Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException.
- Error处理:Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException.
- Error处理:Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException.
- Error处理:Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException.
- 转 Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException.
- Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOv
- 【android初学日志】Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverf<一>
- Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOv
- Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOv
- Conversion to Dalvik format failed: Unable to execute dex
- Conversion to Dalvik format failed: Unable to execute dex
- Conversion to Dalvik format failed: Unable to execute dex: 。。。bin
- Conversion to Dalvik format failed: Unable to execute dex
- 错误: Conversion to Dalvik format failed: Unable to execute dex
- VS环境中,cmake出来的ALL_BUILD项目和 ZERO_CHECK项目的作用
- Valgrind简记
- flash 应用开发 非flash builder
- android根据包名构建第三方应用的上下文Context
- 国内平台比特币(Bitcoin)搬砖流程教学
- Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException.
- 国内首起比特币交易平台诈骗案涉案人被捕
- 比特币都有哪些基本概念和术语?如何通俗地理解它们?
- MFC笔记
- 关于手机rom、ram、internal storage的问题?
- 电话本-----添加错误命令处理
- ICCV 2013 Accepted Tutorials
- 为Red Hat Enterprise Linux Server release 5.5搭建本地YUM源
- hive 元数据升级