I am trying to create a new project from existing source code. I keep getting the following error: "Invalid Project Description", project path "overlaps the location of another project" with the same name. The reason is that I created that project from the source code before, but then I deleted that project and deleted its whole directory, before adding the source code directory again. I tried everything like cleaning and restarting, but nothing worked. I looked in my workspace directory, but there are no traces for the old project. There are several questions around this problem such as this Attempting Android Notepad Tutorial - Exercise 1 - More problems, but none of the answers worked for me!


当前回答

将项目源代码和支持库粘贴到任何其他新创建的文件夹中,并尝试从那里导入。这对我很管用。

其他回答

我也一直在为类似的问题而绞尽脑汁。唯一有帮助的就是遵循这篇文章中的步骤。

将需要的代码复制到工作区文件夹之外的某个地方 使用该文件夹中的现有代码创建一个新项目 项目创建后,右键单击它并重构> Move 把它放到工作区文件夹中。(使用默认位置)

我在Linux中遇到过这个问题,我重命名、删除并重新导入了一个项目。在.metadata的某个地方,它显然还在那里。

我最终通过以下步骤解决了这个问题:

close Eclipse
mv .metadata .metadata_orig
start Eclipse
reset default workspace
reimport projects

这可能并不适用于每个人,特别是如果您已经在多个工作区中有许多项目。但是如果您习惯了重新配置Eclipse(我每次升级到下一个Eclipse版本时都会这样做),那就不太糟糕了。

解决这个问题最简单的方法就是将项目移动到另一个文件夹并导入。这是因为您已经在该文件夹中有了该项目(或具有相同名称的项目)。当您删除project时,eclipse仍然保留对它的引用

Suppose you have something like: /prj/workspace/prj1 /prj/workspace/prj2 And your eclipse workspace is in /prj/workspace level (i.e. /prj/workspace/.metadata). If you're having problem importing prj1 and prj2, you can either move your .metadata somewhere else (/prj/.metadata, /prj/eclipse/.metadata, etc.) or create a sub level in workspace so that it looks like: /prj/workspace/android/prj1 /prj/workspace/android/prj2 And import prj1 and prj2 again. In another word: as long as prj1, prj2, and .metadata are not in the same level it will be fine.