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!


当前回答

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

其他回答

进入工作空间,将项目源代码文件夹移动到工作空间之外的另一个区域(如桌面)。确保在eclipse中删除了项目,然后在该目录中从source创建一个新项目。

您可以做的另一件事是尝试创建一个不同名称的项目(来自第一个项目的源),这样工作空间将包含作为功能项目的新项目。然后,进入您的工作区目录,完全删除包含原始项目的文件夹,或者移动它。尝试再次从源代码加载项目,这次使用第二个项目,用正确的名称命名它。或者,您可以尝试将第二个项目重构为第一个项目的名称。

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.

这个问题也快把我逼疯了,但我知道原因是什么。问题是eclipse不够聪明,不能在自定义的工作空间文件夹中创建与项目同名的文件夹。

解决这个问题的方法是确保你所有的项目都在一个与你的项目名称匹配的文件夹中,否则它会直接将你所有的项目文件转储到这个目录中。您最终看到这个错误的原因是因为它认为您正在将一个项目放在另一个项目中(可能读取了项目配置文件)。

I noticed this is especially a problem when not using the default workspace path. The way I solve this problem is to just add the Project Name to the end of location. So let's say you are putting a project named "HelloWorld" into /Users/name/Documents/projects/android/, you would want to manually add "HelloWorld" to the end of it, like this: /Users/name/Documents/projects/android/HelloWorld. This would ensure that the project is put in it's own folder called "HelloWorld" and not inside some other project. Be sure that if there are any projects not within folders into a folder of the same name as the project to solve the errors.

以我为例,当我打开Eclipse并将计算机设置为睡眠模式,然后醒来工作时,我出现了错误“无效的项目描述”。我需要做的唯一一件事就是关闭我的Eclipse并再次打开它。 我看到当打开Eclipse并让计算机进入睡眠或休眠时,会犯许多其他奇怪的错误!

转到项目的。project文件,确保它显示的名称与项目文件夹中显示的名称相同。如果不是,请更改名称。它会起作用的。