Android 无法执行 dex:java.nio.BufferOverflowException。检查 Eclipse 日志以获取堆栈跟踪

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20778767/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 03:25:54  来源:igfitidea点击:

Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace

androideclipse

提问by liuj

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

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

[2013-12-26 11:24:12 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
[2013-12-26 11:24:12 - Pk6.1.3] Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.

I deleted Android dependencies from project > properties > java build path > libraries. After I clean the project and not run it.

我从project > properties > java build path > libraries. 在我清理项目而不是运行它之后。

I modify project.propertiesfile, target=android-19, and I run it, but I don't want to do this.

我修改了project.properties文件,target=android-19然后运行它,但我不想这样做。

Are there other solutions to solved the problem?

是否有其他解决方案来解决问题?

Thanks.

谢谢。

回答by j2emanue

from Eclipse:

来自日食:

First Right click on project and go to properties.

首先右键单击项目并转到属性。

  1. Go to Java Build Path Screen (from left menu)

  2. Select Libraries Pane.

  3. Highlight Android dependencies

  4. Click Remove

  5. Click Ok.

  1. 转到 Java 构建路径屏幕(从左侧菜单)

  2. 选择库窗格。

  3. 突出显示 Android 依赖项

  4. 单击删除

  5. 单击确定。

enter image description here

在此处输入图片说明

回答by Muhammad Usman Ghani

Right click your project → android tools → android support library.

右键单击您的项目 → android 工具 → android 支持库。

it works for me :)

这个对我有用 :)

回答by Newkie

Right click your project - Properties - Android

and set Project Build Target version higher.

并将项目构建目标版本设置得更高。

I have same problem and this works for me.

我有同样的问题,这对我有用。

回答by Rakesh

I was doing some mistake, now it is working fine for me.

我犯了一些错误,现在它对我来说工作正常。

Remove dependency from: Properties (Alt+Enter) -> Java build path -> libraries tab.

从以下位置删除依赖项:属性 (Alt+Enter) -> Java 构建路径 -> 库选项卡。

回答by Muhammad Usman Ghani

Also check Make sure that the value of android:targetSdkVersion in AndroidManifest.xml matches target=android- in project.properties. If these two values are not the same, building with build tools version 19.0.0 will end in the BufferOverflowException. After That Clean Project it works :)

还要检查确保 AndroidManifest.xml 中 android:targetSdkVersion 的值与 project.properties 中的 target=android- 匹配。如果这两个值不同,则使用构建工具版本 19.0.0 构建将在 BufferOverflowException 中结束。在那个干净的项目之后它起作用了:)

回答by user3798831

If you have other projects than the project you are running in the same workspace, then selected same target android version for all your project.

如果您有其他项目而不是在同一工作区中运行的项目,则为所有项目选择相同的目标 android 版本。

For doing this, go to project properties from eclipse, select Android and from the list choose appropriate android sdk version.

为此,请从 Eclipse 转到项目属性,选择 Android 并从列表中选择适当的 android sdk 版本。

This works for me

这对我有用

回答by Waqleh

Right click your project

右键单击您的项目

then android tools

然后安卓工具

then add support library...

然后添加支持库...

done.

完毕。

回答by Pete

I had to empty the "Name" field of the Application Attributes

我必须清空应用程序属性的“名称”字段