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!
当前回答
将项目源代码和支持库粘贴到任何其他新创建的文件夹中,并尝试从那里导入。这对我很管用。
其他回答
我自己也在这个问题上挣扎了一段时间,我认为发生这种情况的原因是因为(对于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.
我在Linux中遇到过这个问题,我重命名、删除并重新导入了一个项目。在.metadata的某个地方,它显然还在那里。
我最终通过以下步骤解决了这个问题:
close Eclipse mv .metadata .metadata_orig start Eclipse reset default workspace reimport projects
这可能并不适用于每个人,特别是如果您已经在多个工作区中有许多项目。但是如果您习惯了重新配置Eclipse(我每次升级到下一个Eclipse版本时都会这样做),那就不太糟糕了。
如果你希望以以下方式从现有源代码打开一个新项目:
File -> Import -> General -> Existing Project into Workspace
你仍然有“无效的项目描述”的信息。 我只要进去就能解出来
File -> Switch Workspace
选择一个最近的工作场所。
转到项目的。project文件,确保它显示的名称与项目文件夹中显示的名称相同。如果不是,请更改名称。它会起作用的。
推荐文章
- Eclipse调试器总是阻塞在ThreadPoolExecutor上,没有任何明显的异常,为什么?
- 这是在Android中获取用户位置的好方法
- Android从左到右幻灯片动画
- 如何检索视图的维度?
- 如何改变菜单项的文本颜色在安卓?
- Android选择器和文本颜色
- 视图绑定-我如何获得包含布局的绑定?
- 在Android Studio中改变矢量资产的填充颜色
- 在构建中编写注释的语法是什么?gradle文件?
- 如何以编程方式添加按钮色调
- 用Android Studio进行调试永远停留在“等待调试器”状态
- Openssl不被视为内部或外部命令
- 无法执行dex:在Eclipse中超过GC开销限制
- 如何以编程方式将视图添加到视图
- 单击url会打开默认浏览器