项目未建成的原因是

发布于 2024-11-01 06:37:00 字数 8465 浏览 0 评论 0原文

我正在使用 Android SDK for Eclipse 以及 github 的 Egit 插件开发 Android 应用程序。
最近,我在尝试与(远程)master 合并后尝试构建项目时遇到了错误。我在“问题”窗口中列出了此错误:

The project was not built due to "Error updating cache during move/delete.
The resource cannot be moved, renamed or deleted due to an internal error."

在我的错误日志中,我还发现了以前的 Project > 中的错误: Clean

JavaBuilder handling ImageBuilderInternalException while building: Project
org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources.
    at org.eclipse.core.internal.resources.Resource.delete(Resource.java:737)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:114)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:46)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Contains: Error updating cache during move/delete.
The resource cannot be moved, renamed or deleted due to an internal error.
java.io.IOException: Cannot lock C:\Users\Jessbro\Project\.git\index
    at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:187)
    at org.eclipse.jgit.lib.Repository.lockDirCache(Repository.java:932)
    at org.eclipse.egit.core.GitMoveDeleteHook.deleteFile(GitMoveDeleteHook.java:58)
    at org.eclipse.team.internal.core.MoveDeleteManager.deleteFile(MoveDeleteManager.java:50)
    at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1763)
    at org.eclipse.core.internal.resources.Resource.delete(Resource.java:724)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:114)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:46)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

并且:

JavaBuilder handling CoreException while cleaning: Project
org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources.
    at org.eclipse.core.internal.resources.Resource.delete(Resource.java:737)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:114)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.clean(JavaBuilder.java:291)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:218)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:360)
    at org.eclipse.core.internal.resources.Project$1.run(Project.java:523)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1782)
    at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:502)
    at org.eclipse.core.internal.resources.Project.build(Project.java:94)
    at org.eclipse.ui.internal.ide.dialogs.CleanDialog.doClean(CleanDialog.java:312)
    at org.eclipse.ui.internal.ide.dialogs.CleanDialog$1.runInWorkspace(CleanDialog.java:154)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Contains: Error updating cache during move/delete.
The resource cannot be moved, renamed or deleted due to an internal error.
java.io.IOException: Cannot lock C:\Users\Jessbro\Project\.git\index
    at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:187)
    at org.eclipse.jgit.lib.Repository.lockDirCache(Repository.java:932)
    at org.eclipse.egit.core.GitMoveDeleteHook.deleteFile(GitMoveDeleteHook.java:58)
    at org.eclipse.team.internal.core.MoveDeleteManager.deleteFile(MoveDeleteManager.java:50)
    at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1763)
    at org.eclipse.core.internal.resources.Resource.delete(Resource.java:724)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:114)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.clean(JavaBuilder.java:291)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:218)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:360)
    at org.eclipse.core.internal.resources.Project$1.run(Project.java:523)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1782)
    at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:502)
    at org.eclipse.core.internal.resources.Project.build(Project.java:94)
    at org.eclipse.ui.internal.ide.dialogs.CleanDialog.doClean(CleanDialog.java:312)
    at org.eclipse.ui.internal.ide.dialogs.CleanDialog$1.runInWorkspace(CleanDialog.java:154)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

我尝试寻找一些可能的解决方案,但未能找到任何有用的东西。
在看到我的项目名称旁边有一个错误标记但我的任何类都没有标记后,我遇到了这个问题。
我首先搜索了该问题的可能解决方案,其中大多数都解释说要做一个 Project > Clean 这是我的构建错误出现在日志中的时候。
谢谢。

I'm working on an Android App using the Android SDK for Eclipse as well as the Egit plug in for github.
Recently I've encountered an error while trying to build the project after attempting to merge with the (remote) master. I have this error listed in the Problems window:

The project was not built due to "Error updating cache during move/delete.
The resource cannot be moved, renamed or deleted due to an internal error."

In my Error Log I also have from a previous Project > Clean:

JavaBuilder handling ImageBuilderInternalException while building: Project
org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources.
    at org.eclipse.core.internal.resources.Resource.delete(Resource.java:737)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:114)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:46)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Contains: Error updating cache during move/delete.
The resource cannot be moved, renamed or deleted due to an internal error.
java.io.IOException: Cannot lock C:\Users\Jessbro\Project\.git\index
    at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:187)
    at org.eclipse.jgit.lib.Repository.lockDirCache(Repository.java:932)
    at org.eclipse.egit.core.GitMoveDeleteHook.deleteFile(GitMoveDeleteHook.java:58)
    at org.eclipse.team.internal.core.MoveDeleteManager.deleteFile(MoveDeleteManager.java:50)
    at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1763)
    at org.eclipse.core.internal.resources.Resource.delete(Resource.java:724)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:114)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:46)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

and:

JavaBuilder handling CoreException while cleaning: Project
org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources.
    at org.eclipse.core.internal.resources.Resource.delete(Resource.java:737)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:114)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.clean(JavaBuilder.java:291)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:218)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:360)
    at org.eclipse.core.internal.resources.Project$1.run(Project.java:523)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1782)
    at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:502)
    at org.eclipse.core.internal.resources.Project.build(Project.java:94)
    at org.eclipse.ui.internal.ide.dialogs.CleanDialog.doClean(CleanDialog.java:312)
    at org.eclipse.ui.internal.ide.dialogs.CleanDialog$1.runInWorkspace(CleanDialog.java:154)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Contains: Error updating cache during move/delete.
The resource cannot be moved, renamed or deleted due to an internal error.
java.io.IOException: Cannot lock C:\Users\Jessbro\Project\.git\index
    at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:187)
    at org.eclipse.jgit.lib.Repository.lockDirCache(Repository.java:932)
    at org.eclipse.egit.core.GitMoveDeleteHook.deleteFile(GitMoveDeleteHook.java:58)
    at org.eclipse.team.internal.core.MoveDeleteManager.deleteFile(MoveDeleteManager.java:50)
    at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1763)
    at org.eclipse.core.internal.resources.Resource.delete(Resource.java:724)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:114)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.clean(JavaBuilder.java:291)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:218)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:360)
    at org.eclipse.core.internal.resources.Project$1.run(Project.java:523)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1782)
    at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:502)
    at org.eclipse.core.internal.resources.Project.build(Project.java:94)
    at org.eclipse.ui.internal.ide.dialogs.CleanDialog.doClean(CleanDialog.java:312)
    at org.eclipse.ui.internal.ide.dialogs.CleanDialog$1.runInWorkspace(CleanDialog.java:154)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

I've tried searching for some possible solutions but haven't been able to find anything of use.
I came across this problem after seeing an error marker next to my project name but had no markers for any of my classes.
I first searched possible solutions to that problem and most of them explained to do a Project > Clean which is when my build errors showed up in the log.
Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

溇涏 2024-11-08 06:37:00

由于内部错误,无法移动、重命名或删除资源。
java.io.IOException:无法锁定 C:\Users\Jessbro\Project\.git\index

这将是由于文件的存在:
... \.git\index-lock - 文件大小应该为 0

EGit 认为另一个 git 客户端正在执行独占操作。但是,我发现当 EGit 抛出异常(来自较早的操作)时,它无法清理自己的锁定文件!

要解决此问题,请检查是否没有 git 客户端访问您的本地 git 存储库(也可能关闭 Eclipse),然后将其删除。

其他想法:

  • 升级 EGit!后来的版本比 9 个月前发布问题时要好。 (我在 git 工作目录中遇到了“Eclipse 链接文件夹”问题。因此,EGit 仍然会崩溃 - 但现在只是针对特定的 git 操作,而不是几乎每个 Java 重构操作!)

  • 在 Windows 上,多个 git 客户端可以以令人讨厌的方式互相破坏,因为 Windows 文件锁定比 Linux 上更具“排他性”(无论如何默认情况下 - 当调用“常用”C/Java 函数时)

旁白:实际上后面的问题非常糟糕,以至于我已经切换到命令-line 几乎完全,并且只是暂时“附加”EGit(团队 -> 共享项目),仅用于 git annotate!这也节省了大量的内存。遗憾的是,EGit 看起来集成得相当好。至少连接/拆卸非常快。

The resource cannot be moved, renamed or deleted due to an internal error.
java.io.IOException: Cannot lock C:\Users\Jessbro\Project\.git\index

This will be due to the presence of a file:
... \.git\index-lock - it should have file size 0

EGit thinks that another git client is performing an exclusive action. However, I have found that when EGit throws an exception (from an earlier operation) it fails to clean up its own lock file!

To solve, check that no git clients are accessing your local git repo (maybe close Eclipse too) and simply delete it.

Other thoughts:

  • Upgrade EGit! Later versions are better than ~9 months ago when the question was posted. (I had issues with an "Eclipse link folder" inside a git working directory. EGit can still crash because of that - but now just on specific git actions rather than practically every Java refactoring action!)

  • On windows, multiple git clients can clobber each other in nasty ways, since Windows file-locking is more 'exclusive' than on Linux (by default anyway - when calling the "usual" C/Java functions)

Aside: actually the later problem is so bad that I've switched to command-line almost exclusively, and just 'attach' EGit (Team -> Share Project) temporarily just for git annotate! This also saves a lot of RAM. It's a shame, because EGit seems quite nicely integrated. At least attaching / detaching is very quick.

筱武穆 2024-11-08 06:37:00

在这种情况下,我会切换到命令行界面,并检查:

  • 项目内的 git status
  • 确保合并已完成(检查是否存在合并冲突)
  • 克隆存储库在新目录中
  • 导入新工作区中的所述项目,看看是否可以在那里重建它。

这更像是一种解决方法,而不是对您的问题实际情况的解释,但至少可以让您继续前进。

In such a case, I would switch to a command line interface, and check:

  • git status within the project
  • make sure the merge has been completed (check if there isn't some merge conflicts)
  • clone the repo in a new directory
  • import said project in a new workspace, to see if it can be rebuild there.

That is more a workaround than an explanation of what is actually going for your issue, but at least that would allow to move on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文