本文介绍了构建应用程序时的BufferOverflowException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我想要运行我的Android应用程序,我会收到一个错误:

Everytime i want to run my Android application i get a error:

[2013-11-02 13:05:36 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
[2013-11-02 13:05:36 - **********] Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.

我google了,但没有找到任何东西。我已经将permsize设置为512m,Xms1024m和Xmx2048m。
我正在使用v22.0.0-675183。

I google'd it but haven't found anything. I have set the permsize to 512m, Xms1024m and Xmx2048m.I'm using v22.0.0-675183.

.Log:

!ENTRY com.android.ide.eclipse.adt 4 0 2013-11-02 13:05:36.597
!MESSAGE Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log             for stack trace.
!STACK 0
java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Unknown Source)
at java.nio.HeapByteBuffer.putShort(Unknown Source)
at com.android.dex.Dex$Section.writeShort(Dex.java:818)
at com.android.dex.Dex$Section.writeTypeList(Dex.java:870)
at com.android.dx.merge.DexMerger$3.write(DexMerger.java:437)
at com.android.dx.merge.DexMerger$3.write(DexMerger.java:423)
at com.android.dx.merge.DexMerger$IdMerger.mergeUnsorted(DexMerger.java:317)
at com.android.dx.merge.DexMerger.mergeTypeLists(DexMerger.java:423)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:163)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:187)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:187)
at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:780)
at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:593)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
at org.eclipse.core.internal.resources.Project.build(Project.java:124)
at com.android.ide.eclipse.adt.internal.project.ProjectHelper.doFullIncrementalDebugBuild(ProjectHelper.java:1057)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:147)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)


推荐答案

尝试添加Android支持库:D

try to Add Android Support Library :D https://stackoverflow.com/a/19803777/544265

这篇关于构建应用程序时的BufferOverflowException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 01:16