Java 构建过程中发生错误。在项目“com.xxx...”上运行构建器“Android 预编译器”时出错。com/android/sdklib/util/SparseArray

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19216462/
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-12 15:09:09  来源:igfitidea点击:

Errors occurred during the build. Errors running builder 'Android Pre Compiler' on project 'com.xxx...'. com/android/sdklib/util/SparseArray

javaandroideclipsebuild

提问by user2771655

Errors occurred during the build.
Errors running builder 'Android Pre Compiler' on project       'com.xxx.android.xxx'.
com/android/sdklib/util/SparseArray

I get this error from today when I try to build the project. This is not only to this Android project I get this for all the projects.

当我尝试构建项目时,我从今天开始收到此错误。这不仅适用于这个 Android 项目,我在所有项目中都得到了它。

Any idea what has happened? This was working yesterday but today I can't build any project on workspace.
below is eclipse log file.

知道发生了什么吗?这昨天有效,但今天我无法在工作区上构建任何项目。
下面是日食日志文件。

ENTRY org.eclipse.core.resources 4 75 2013-10-07 10:09:12.562
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 com.android.ide.eclipse.adt 4 75 2013-10-07 10:09:12.562
!MESSAGE Errors running builder 'Android Pre Compiler' on project     'com.xxx.android.xxx'.
!STACK 0
java.lang.NoClassDefFoundError: com/android/sdklib/util/SparseArray
at com.android.ide.eclipse.adt.internal.resources.manager.DynamicIdMap.<init>(DynamicIdMap.java:29)
at com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources.<init>(ProjectResources.java:67)
at com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources.create(ProjectResources.java:74)
at com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager.getProjectResources(ResourceManager.java:160)
at com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.doClean(PreCompilerBuilder.java:772)
at com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.clean(PreCompilerBuilder.java:741)
at org.eclipse.core.internal.events.BuildManager.run(BuildManager.java:728)
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:239)
at org.eclipse.core.internal.events.BuildManager.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at    org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:513)
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:422)
at org.eclipse.ui.internal.ide.dialogs.CleanDialog.doClean(CleanDialog.java:313)
at org.eclipse.ui.internal.ide.dialogs.CleanDialog.runInWorkspace(CleanDialog.java:151)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

采纳答案by user2771655

Eclipse platform version=4.2.0. Android SDK 4.3 and 4.2.2 both I used. Nothing worked for me in the web. Tried to update the eclipse and many more setting changes as suggested in forums.

Eclipse 平台版本=4.2.0。我使用了 Android SDK 4.3 和 4.2.2。在网络上没有什么对我有用。尝试按照论坛中的建议更新日食和更多设置更改。

Eventually I use a fresh eclipse. That was the only way.

最终我使用了新的日食。那是唯一的办法。

回答by androiddev19

on eclipse menu, Help > Check for Updates.

在 eclipse 菜单上,帮助 > 检查更新。

according to the comments on how to Fix com/android/sdklib/util/SparseArray in android

根据关于如何在 android 中修复 com/android/sdklib/util/SparseArray 的评论

回答by SkorpEN

In my case simillar error was produce by eclipse, when in class i write only

在我的情况下,eclipse 产生了类似的错误,在课堂上我只写

import

this result in invalid compilation in file below problematic one.

这导致以下问题的文件中的无效编译。