Eclipse 不断构建工作空间...和构建工作空间...和构建工作空间

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

Eclipse keeps Building workspace... and Building workspace... and Building workspace

androideclipsedebuggingadt

提问by Eternal Learner

Why would Eclipse, when building an Android project, get stuck in an infinite loop for Building workspace... and (re) Building workspace... and (re) Building workspace...

为什么 Eclipse 在构建 Android 项目时会陷入构建工作区……和(重新)构建工作区……和(重新)构建工作区的无限循环中……

Is this a known bug?

这是一个已知的错误?

What is the proper way to get out of this loop?

摆脱这个循环的正确方法是什么?

Notes:

笔记:

  1. If I uncheck Project > Build Automatically, it builds fine and even exports a perfectly running signed release APK.
  2. This problem only started after I upgraded to the latest SDK r19. Prior to that (SDK r11) I never experienced this problem.
  3. Bug 160868describes exactly this problem. But hasn't it being solved since then?
  4. A similar problem description found herebut like the previous one, it's old and not directly related to Android development.
  5. Issue 27940suggests a bug in handling a const named BuildConfig.DEBUGwhich may or may not be related. But hasn't it been fixed in r18???
  6. I found this great tip for auto tagging / date-stampingin the Android build system, but I am not using anything like that, in addition to double-checking and verifying that builders come at the right order the Project builders list order (same order as other projects that do not exhibit this infinite-loop build behavior).
  7. My hunch tells me there might be a lock-file or flag that somehow got stuck (read-only mode?) and thus confuses the build system. Any idea what that boolean may be and where to find it?
  8. If I first open another project in the same workspace (that doesn't exhibit this problem), the project that has this problem miraculously stops the infinite rebuilding. This doesn't happen if I reverse the order of which project is opened first. Does this imply gremlins in the Eclipse/SDK/ADT build system?
  1. 如果我取消选中Project > Build Automatically它,它会构建得很好,甚至会导出一个完美运行的签名版 APK。
  2. 这个问题只有在我升级到最新的 SDK r19 后才开始。在此之前(SDK r11)我从未遇到过这个问题。
  3. 错误 160868正是描述了这个问题。但是从那以后就没有解决了吗?
  4. 这里找到一个类似的问题描述但与上一个类似,它很旧,与 Android 开发没有直接关系。
  5. 问题 27940表明在处理BuildConfig.DEBUG可能相关或可能不相关的 const 命名时存在错误。但是r18不是已经修复了吗???
  6. 我发现了这个在 Android 构建系统中自动标记/日期戳的很棒的技巧,但我没有使用类似的东西,除了仔细检查和验证构建器是否以正确的顺序出现在项目构建器列表顺序(相同的顺序其他项目没有表现出这种无限循环构建行为)。
  7. 我的预感告诉我,可能有一个锁定文件或标志以某种方式卡住了(只读模式?),从而混淆了构建系统。知道那个布尔值可能是什么以及在哪里可以找到它吗?
  8. 如果我首先在同一个工作区中打开另一个项目(没有出现这个问题),出现这个问题的项目奇迹般地停止了无限重建。如果我颠倒首先打开哪个项目的顺序,则不会发生这种情况。这是否意味着 Eclipse/SDK/ADT 构建系统中的小鬼?

No "blind shooting" please: answer this question only if you have personally experienced this amazing phenomenon (and solved it) or can point to an article that experienced this amazing phenomenon (and solved it).

请不要“盲目射击”:仅当您亲身经历过这个惊人的现象(并解决了它)或者可以指出经历过这种惊人现象(并解决了它)的文章时才回答这个问题。

采纳答案by Eternal Learner

Turns out bug 27940hasn't been fixed yet.

结果发现错误 27940尚未修复。

I use the following workaround:

我使用以下解决方法:

  1. Disable "Project > Build Automatically"
  2. Project > Clean
  3. Project > Build All
  1. 禁用“项目>自动构建”
  2. 项目 > 清洁
  3. 项目 > 全部构建

回答by Alex Lockwood

Did you add your workspace to a Windows 7 library (i.e. the Windows Explorer Favorites or Windows Explorer Libraries)? Another user had a similar issue here.

您是否将您的工作区添加到 Windows 7 库(即 Windows 资源管理器收藏夹或 Windows 资源管理器库)?另一个用户在这里遇到了类似的问题。

If you have something open in a different editor (in the target directory of your project), this can also cause an infinite "Build Workspace" loop.

如果您在不同的编辑器中(在项目的目标目录中)打开了某些内容,这也可能导致无限的“构建工作区”循环。

回答by Lonzak

I solved it by opening my module's .project file. There were two redundant entries and deleting one helped:

我通过打开模块的 .project 文件解决了这个问题。有两个多余的条目,删除一个有帮助:

<buildCommand>
    <name>org.eclipse.m2e.core.maven2Builder</name>
    <arguments>
    </arguments>
</buildCommand>
<buildCommand>
    <name>org.eclipse.m2e.core.maven2Builder</name>
    <arguments>
    </arguments>
</buildCommand>

Sometimes it can also be caused by the following two entries from which you have to remove the older org.maven.ideentry

有时它也可能是由以下两个条目引起的,您必须从中删除旧org.maven.ide条目

<buildCommand>
  <name>org.maven.ide.eclipse.maven2Builder</name>
</buildCommand>
<buildCommand>
  <name>org.eclipse.m2e.core.maven2Builder</name>
</buildCommand>

It may also be that there are two identical natures:

也可能有两种相同的性质:

<natures>
    <nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<natures>
    <nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>

or two natures from which one is old

或两种本性,其中一个是旧的

<natures>
    <nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<natures>
    <nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>

Just delete the redundant one or the old org.maven.ide.eclipse.maven2Nature

只需删除多余的或旧的 org.maven.ide.eclipse.maven2Nature

回答by lifo

I had this same issue pop up for me and for awhile I couldn't figure out why. Then I finally figured out what was causing it (for me anyway).

我遇到了同样的问题,有一段时间我不知道为什么。然后我终于弄清楚是什么导致了它(无论如何对我来说)。

It turns out I had an old project in my workspace that uses one of my custom libraries but the build path was not setup properly to use the library (its a shame Eclipse couldn't simply tell me that!). I had copied this workspace from another hard drive and I guess the file paths were all different now.

事实证明,我的工作区中有一个旧项目,它使用我的自定义库之一,但未正确设置构建路径以使用该库(遗憾的是 Eclipse 不能简单地告诉我!)。我已经从另一个硬盘驱动器复制了这个工作区,我猜现在文件路径都不同了。

So, if any of your projects in your workspace use any external libraries make sure the build path has your library defined (Properties -> Java Build Path -> Projects[tab].

因此,如果您的工作区中的任何项目使用任何外部库,请确保构建路径已定义您的库(Properties -> Java Build Path -> Projects[tab].

I hope that helps someone else.

我希望能帮助别人。

回答by Alvi

Apart from building all project you can Close the projects that are finished.
click on the finished project and
go to
project ->close project
hope this will work

除了构建所有项目,您还可以关闭已完成的项目。
单击完成的项目并
转到
项目 -> 关闭项目
希望这会起作用

回答by user2371392

Both projects are referenced to each other.

这两个项目相互引用。

Go to "Project->Properties->Project References" and check the references on both projects, that causes like an endless loop when building automatically.

转到“项目->属性->项目引用”并检查两个项目上的引用,这会导致自动构建时无限循环。

回答by pj9220

In my case this could be solved in the following way:

就我而言,这可以通过以下方式解决:

I had a command line window open with the current directory set into a target-folder of the projects to be build. That caused the infinite loop. Closing the window and problem solved.

我打开了一个命令行窗口,当前目录设置到要构建的项目的目标文件夹中。这导致了无限循环。关上窗户,问题就解决了。

I guess, that if something prevents eclipse to remove some target folder, it will try over and over again.

我猜,如果有什么东西阻止 eclipse 删除某个目标文件夹,它会一遍又一遍地尝试。

回答by Klykoo

I had the same problem and resolved it by remove: Project > Properties > Builders > JavaScript Validator

我遇到了同样的问题并通过删除解决了它:项目 > 属性 > Builders > JavaScript Validator

I had no javascript on my webapp.

我的 webapp 上没有 javascript。

回答by sjngm

To add my two cents: Yes, it's 2019, so Eclipse 2019-06 is installed now... eyerollI mean I occasionally had the problem with earlier versions, too, but after upgrading to Eclipse 2019-06 I suddenly had three such "sleepers" running in parallel and wasn't able to do anything any more.

添加我的两分钱:是的,现在是 2019 年,所以现在安装了 Eclipse 2019-06... eyeroll我的意思是我的早期版本偶尔也有问题,但是升级到 Eclipse 2019-06 后我突然有三个这样的“睡眠者”并行运行,无法再做任何事情。

To make it work again I had to delete the directory tree of my projects in my Maven repository. So in my case I only had to delete the directory ~/.m2/repository/com/sjngm.

为了让它再次工作,我不得不在我的 Maven 存储库中删除我的项目的目录树。所以在我的情况下,我只需要删除目录~/.m2/repository/com/sjngm

Then I restarted Eclipse and during the start-up it seemed to download the now missing dependencies underneath that directory from our internal repository.

然后我重新启动了 Eclipse,在启动过程中它似乎从我们的内部存储库中下载了该目录下现在缺少的依赖项。