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!


当前回答

复制项目到你的工作空间,从eclipse文件>新建>项目创建新的Android应用程序项目,瞧。

其他回答

我自己也在这个问题上挣扎了一段时间,我认为发生这种情况的原因是因为(对于Android)有两种方法将项目导入到工作区

1)文件>导入>General>现有项目到工作区 2)文件>导入>Android>现有代码到工作区

这里描述的错误与方法2有关。

对于方法1),如果项目已经在工作区中,只要取消选中“将项目复制到工作区”框,就不会出现重叠问题。

编辑: 还有第三种方法,在我最初的文章中没有提到。

3)文件>新的>其他>Android>现有的Android项目到工作区

这个问题也快把我逼疯了,但我知道原因是什么。问题是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.

我使用以下步骤解决了这个问题:

1) File -> Import
2) Click General then select Existing Projects into Workspace
3) Click Next
4) Browse the directory of the project

单击Finish。

这对我很有效

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

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

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

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

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