Unable to execute dex: java.nio.BufferOverflowException

来源:互联网 发布:android书籍推荐 知乎 编辑:程序博客网 时间:2024/05/16 00:38

Unable to execute dex: java.nio.BufferOverflowException


当运行项目时出现以下错误:

[2014-01-16 09:27:35 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
[2014-01-16 09:27:35 - tab_demo] Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.


你可能直接import 导入的代码,代码本身会在项目下面建立一个依赖包:Android Dependencies;在eclipse中直接右键 Build Path 中将Android Dependenciesremove掉就可以了.


以前的.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>  


调整后的.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 project 就可以运行了。


问题总结:

对于这个问题,发现在升级SDK Tool到22.3之后,也就是Android 4.4的SDK及工具之后,加载之前老版本的项目都会出现这个问题;


0 0
原创粉丝点击