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!
当前回答
今天我意外地解决了这个问题:
以下2个步骤可能不涉及,但不确定:
从(Eclipse菜单)调用*“/Window/Android SDK Manager”并更新a)“Android SDK Tools”“Android SDK平台工具”包 从Eclipse菜单“/Help/Check for Updates”调用并更新Eclipse。重新启动Eclipse。
以下步骤是必要的:
From eclipse menu "/File/Import/Android/Existing Android Code Into Workspace" Browse and select problematic project/or problematic projectS parent directory. Check "Copy projects into workspace". Check "Add projects into working sets". Press finish. [Optional scenario]: If project(s) and their containing folders have been renamed with the fully qualified package names then simply click on project node parent (where you see project package name instead of project's old name) in Eclipse and rename project with old name. Eclipse will rename folder too.
附注:在日蚀朱诺号上测试过。
Edit: Many times have passed since this answer and new Eclipse and Android SDK arrived. They have no much more problems during importing existing projects. The only thing one has to consider before importing is to move project folders(those ones one is willing to import) outside of eclipse workspace dir and then check checkboxes ("copy projects into working sets", "add projects into wokring sets") in import wizard dialog. Also I recommend doing this with latest Android SDK because it no more imports projects with dummy names and does not rename folders as it did in some custom cases.
其他回答
解决这个问题最简单的方法就是将项目移动到另一个文件夹并导入。这是因为您已经在该文件夹中有了该项目(或具有相同名称的项目)。当您删除project时,eclipse仍然保留对它的引用
我自己也在这个问题上挣扎了一段时间,我认为发生这种情况的原因是因为(对于Android)有两种方法将项目导入到工作区
1)文件>导入>General>现有项目到工作区 2)文件>导入>Android>现有代码到工作区
这里描述的错误与方法2有关。
对于方法1),如果项目已经在工作区中,只要取消选中“将项目复制到工作区”框,就不会出现重叠问题。
编辑: 还有第三种方法,在我最初的文章中没有提到。
3)文件>新的>其他>Android>现有的Android项目到工作区
如果你希望以以下方式从现有源代码打开一个新项目:
File -> Import -> General -> Existing Project into Workspace
你仍然有“无效的项目描述”的信息。 我只要进去就能解出来
File -> Switch Workspace
选择一个最近的工作场所。
而不是从Android ->现有的Android代码导入工作空间,你必须使用通用->现有的项目到工作空间。这可能是一个解决方案。
以下是我做的非常有效的方法。我只是在通用下导入了一个现有的项目,而不是导入一个android项目。
推荐文章
- Visual Studio代码- URI的目标不存在" package:flutter/material.dart "
- Tab在平板设备上不采用全宽度[使用android.support.design.widget.TabLayout]
- 我们应该用RecyclerView来代替ListView吗?
- App-release-unsigned.apk没有签名
- 如何在对话框中创建编辑文本框
- 在viewpager中获取当前Fragment实例
- 如何右对齐小部件在水平线性布局安卓?
- 如何创建EditText与十字(x)按钮在它的结束?
- 电话:用于文本输入的数字键盘
- 如何设置不透明度(Alpha)的视图在Android
- Flutter:升级游戏商店的版本代码
- Android构建脚本库:jcenter VS mavencentral
- 应用程序无法打开,因为它来自一个身份不明的开发者
- Android -包名称约定
- 在Android上以编程方式安装应用程序