将项目导入Eclipse时,项目描述无效

时间:2023-01-17 18:15:24

I know this question is posted already here, but that doesn't solve my problem.

我知道这个问题已在此处发布,但这并不能解决我的问题。

I pull a project from github branch, and when i try to import it : File->Import->General->Existing projects into workspace then Select root directory and here when i click on Finish button i get Invalid project description.

我从github分支中拉出一个项目,当我尝试导入它时:文件 - >导入 - >常规 - >现有项目进入工作区然后选择根目录,这里当我点击完成按钮时,我得到无效的项目描述。

I am pulling the project into a folder called Android, this folder contains the main folder of the project MyAndroidProject which i imported in Eclipse.

我将项目拉入一个名为Android的文件夹,该文件夹包含我在Eclipse中导入的项目MyAndroidProject的主文件夹。

I don't know what is wrong here.

我不知道这里有什么问题。

4 个解决方案

#1


67  

I know I'm late to the party, but just in case someone else is stuck at this point, just like me a couple of minutes ago: You could try File>Import>Existing Android Code into Workspace. I had the Git repository I wanted to import directly in my workspace. Still, I needed to check the Copy projects into workspace option in order to make it work.

我知道我已经迟到了,但是为了防止其他人被困在这一点上,就像我几分钟前一样:你可以尝试将文件>导入>现有Android代码放入工作区。我有我想在我的工作区直接导入的Git存储库。不过,我还是需要检查“将项目复制到工作区”选项以使其正常工作。

Edit

I just checked out the link from one of the comments above, recommending File>Import>General>Existing Project into Workspace. I should mention that the eclipse project metadata was not under version control in my case, rendering an import as existing project impossible! This solution applies to existing android code without .project files etc.

我刚刚从上面的一条评论中查看了链接,建议将文件>导入>常规>现有项目导入工作区。我应该提一下,在我的情况下,eclipse项目元数据不受版本控制,因为现有项目无法导入!此解决方案适用于没有.project文件等的现有android代码。

Edit 2

Just another remark: I realized recently that this issue only seems to occur if the project root also is the repository root, much like this:

只是另一句话:我最近意识到,如果项目根目录也是存储库根目录,那么这个问题似乎只会发生,就像这样:

workspace  
└─ project root  
   └┬ .git
    ├ src
    └ ...

When I moved the project just one directory level lower, the issue disappeared.

当我将项目移动到一个较低的目录级别时,问题就消失了。

#2


10  

Just move the project folder one directory lower ( make another folder in the directory & copy your project into that folder. Now import the project with this newly created version. )

只需将项目文件夹下移一个目录(在目录中创建另一个文件夹并将项目复制到该文件夹​​中。现在使用这个新创建的版本导入项目。)

#3


2  

Had same issue, changed the workspace to one directory above the project and then imported project. Worked for me

有同样的问题,将工作区更改为项目上方的一个目录,然后导入项目。为我工作

#4


1  

I've just read this very old question. The problem is in the Eclipse specific folders.

我刚读过这个非常古老的问题。问题出在Eclipse特定文件夹中。

Simply remove .settings and .project and reimport.

只需删除.settings和.project并重新导入即可。

#1


67  

I know I'm late to the party, but just in case someone else is stuck at this point, just like me a couple of minutes ago: You could try File>Import>Existing Android Code into Workspace. I had the Git repository I wanted to import directly in my workspace. Still, I needed to check the Copy projects into workspace option in order to make it work.

我知道我已经迟到了,但是为了防止其他人被困在这一点上,就像我几分钟前一样:你可以尝试将文件>导入>现有Android代码放入工作区。我有我想在我的工作区直接导入的Git存储库。不过,我还是需要检查“将项目复制到工作区”选项以使其正常工作。

Edit

I just checked out the link from one of the comments above, recommending File>Import>General>Existing Project into Workspace. I should mention that the eclipse project metadata was not under version control in my case, rendering an import as existing project impossible! This solution applies to existing android code without .project files etc.

我刚刚从上面的一条评论中查看了链接,建议将文件>导入>常规>现有项目导入工作区。我应该提一下,在我的情况下,eclipse项目元数据不受版本控制,因为现有项目无法导入!此解决方案适用于没有.project文件等的现有android代码。

Edit 2

Just another remark: I realized recently that this issue only seems to occur if the project root also is the repository root, much like this:

只是另一句话:我最近意识到,如果项目根目录也是存储库根目录,那么这个问题似乎只会发生,就像这样:

workspace  
└─ project root  
   └┬ .git
    ├ src
    └ ...

When I moved the project just one directory level lower, the issue disappeared.

当我将项目移动到一个较低的目录级别时,问题就消失了。

#2


10  

Just move the project folder one directory lower ( make another folder in the directory & copy your project into that folder. Now import the project with this newly created version. )

只需将项目文件夹下移一个目录(在目录中创建另一个文件夹并将项目复制到该文件夹​​中。现在使用这个新创建的版本导入项目。)

#3


2  

Had same issue, changed the workspace to one directory above the project and then imported project. Worked for me

有同样的问题,将工作区更改为项目上方的一个目录,然后导入项目。为我工作

#4


1  

I've just read this very old question. The problem is in the Eclipse specific folders.

我刚读过这个非常古老的问题。问题出在Eclipse特定文件夹中。

Simply remove .settings and .project and reimport.

只需删除.settings和.project并重新导入即可。