我正在使用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
,这是我的构建错误出现在日志中的情况。
感谢。
答案 0 :(得分:1)
The resource cannot be moved, renamed or deleted due to an internal error.
java.io.IOException: Cannot lock C:\Users\Jessbro\Project\.git\index
这将是由于存在文件:
... \.git\index-lock
- 文件大小应为0
EGit认为另一个git客户端正在执行独占操作。但是,我发现当EGit抛出异常(来自之前的操作)时,它无法清理自己的锁定文件!
要解决这个问题,请检查没有git客户端正在访问您的本地git repo(也可能关闭Eclipse)并简单地将其删除。
其他想法:
升级EGit!当问题发布时,后期版本比~9个月前更好。 (我在git工作目录中遇到了“Eclipse链接文件夹”的问题.EGIT仍然会因此而崩溃 - 但现在只是针对特定的git操作而不是几乎所有的Java重构操作!)
在Windows上,多个git客户端可能会以讨厌的方式互相攻击,因为Windows文件锁定比Linux上更加“独占”(默认情况下,无论如何 - 在调用“常用”C / Java函数时)< / p>
除此之外:实际上后来的问题非常糟糕,我几乎完全转向命令行,只是为git annotate
暂时“附加”EGit(团队 - >分享项目)!这也节省了大量的RAM。这是一种耻辱,因为EGit似乎很好地整合了。至少连接/拆卸非常快。
答案 1 :(得分:0)
在这种情况下,我会切换到命令行界面,并检查:
git status
这更像是一种解决方法,而不是解释你的问题究竟是什么,但至少可以继续前进。