不能将项目导入Eclipse工作区

时间:2021-12-29 21:39:04

So, I have been using eclipse in Windows for years. I have a few android projects that I have been working on lately. But I'm getting stuck on something so weird.

因此,多年来我一直在Windows中使用eclipse。我最近在做一些android项目。但我被困在一件很奇怪的事情上了。

The problem is I'm using eclipse on both windows and Linux now. (Yeah i feel linux is better and much faster). I want to get all my projects that I was using on Windows into Linux Eclipse workspace (Yes I created another workspace because I didnt know if I could work on same workspace in both versions viz linux and windows eclipse). Now, the weird part is I CANNOT IMPORT THOSE PROJECTS INTO MY OTHER WORKSPACE! This is driving me crazy.

问题是我现在在windows和Linux上都使用eclipse。(是的,我觉得linux更好更快)。我想把我在Windows上使用的所有项目都放到Linux Eclipse工作区中(是的,我创建了另一个工作区,因为我不知道我是否可以在Linux和Windows Eclipse两个版本的同一个工作区中工作)。现在,奇怪的是我不能将这些项目导入到我的其他工作空间中!这让我发疯。

I go to my Linux Eclipse workspace -> Import -> Add existing android proj -> browse -> Root dir of my android project -> (Ecipse does show the projects on the frame below -> I click finish -> NOTHING. I just sit there, waiting, and nothing happens. I have searched around here in *, but none of the problems resembles this.

我进入我的Linux Eclipse工作空间->导入->添加现有的android proj ->浏览->我的android项目的根目录-> (Ecipse确实显示了下面框架上的项目->我点击finish ->什么都没有。我只是坐在那里等待,什么也没发生。我在*上搜索过,但是没有一个问题像这样。

Yes I have access to the workspace folder, yes I can create folders, etc etc.

是的,我可以访问工作区文件夹,是的,我可以创建文件夹,等等。

Please can someone tell me how I can import projects that are being detected but NOT imported?

请告诉我如何导入正在检测但未导入的项目?

thanks.

谢谢。

9 个解决方案

#1


11  

I solved this by importing the project in the following manner:

我通过以下方式导入项目来解决这个问题:

File > Import > Android > Existing Android Code Into Workspace

文件>导入> Android >现有的Android代码到工作空间

Click Next, then Browse...

单击Next,然后浏览…

Select your project root directory, and check the box for Copy projects into workspace. Click Finish.

选择项目根目录,并选中将项目复制到工作区中的复选框。单击Finish。

Hope it will help you.

希望它能对你有所帮助。

#2


8  

I also faced the same problem for long, today only I found out the solution!

我也面临同样的问题很长时间,直到今天我才发现了解决方案!

It's all lies in .project and .classpath files inside project's root directory. While trying to import any project into workspace, if your project does not gets listed, that means .project and/or .classpath files are either missing or corrupt. Usually these files are hidden, so you never know what is the issue.

它们都位于项目根目录中的.project和.classpath文件中。当尝试将任何项目导入到工作区中时,如果您的项目没有被列出,这意味着.project和/或.classpath文件要么丢失,要么损坏。通常这些文件是隐藏的,所以你永远不知道问题出在哪里。

For Ubuntu, follow steps below:

对于Ubuntu,请遵循以下步骤:

step 1. go to any project root directory in your workspace and press Ctrl+H to see hidden files.

步骤1。转到工作区中的任何项目根目录并按Ctrl+H查看隐藏的文件。

step 2. copy .project and .classpath files from there and paste to the other project directory that you wanted to import.

步骤2。从那里复制.project和.classpath文件,并粘贴到要导入的另一个项目目录。

step 3. Open the .project file and update name tag to project name.

步骤3。打开.project文件并将name标记更新为project name。

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
 <name>Name of the project</name>
 <comment></comment>
 ....

step 4. close the folder and import the project, it will be definitely listed in the import wizard now!!

步骤4。关闭文件夹并导入项目,它将会在导入向导中列出!!

#3


3  

I also encountered the same problem.

我也遇到了同样的问题。

you need to update ADT (Eclipse Plugin) to work with new Android SDK.

您需要更新ADT (Eclipse插件)以使用新的Android SDK。

click Help > Check for Updates

单击帮助>检查更新

after ADT updated, you can import your project from File > Import

在ADT更新后,您可以从文件>导入项目

#4


2  

Make sure to check to see if the AndroidManifest.xml file is present in either the folder or a sub folder. You must have that file in order to import.

请务必检查一下是否显示了android。xml文件存在于文件夹或子文件夹中。为了导入,您必须拥有该文件。

This is the issue I had. Luckily I have the unlimited history feature in DropBox so I was able to use that to get the last existing version of the file. Once I added it, importing worked just fine.

这是我的问题。幸运的是,我在DropBox上有无限制的历史功能,所以我可以使用它来获取文件的最后一个现有版本。一旦我添加了它,导入工作就很好了。

#5


1  

I'm facing the same issue, here what i have done. - In Eclipse, Go to windows -> Preferences - choose Android, set your Android SDK Location make sure you have at least one of the Android platform in the table. - Apply and Ok.

我面临着同样的问题,这就是我所做的。-在Eclipse中,转到windows ->首选项——选择Android,设置Android SDK位置,确保表中至少有一个Android平台。——应用和好的。

done, I try import, and it's fine. Hope it help.

完成后,我尝试导入,没问题。希望它帮助。

#6


1  

It could be that the project already exists in the workspace. The solution is to either change your workspace location or just rename the project you're importing.

项目可能已经存在于工作区中。解决方案是要么更改工作区位置,要么只是重命名正在导入的项目。

#7


0  

After importing the file, you can deselect the in library from properties section. It worked for me

导入该文件后,您可以从properties部分取消对库的选择。它为我工作

#8


0  

if all the sulotions above didnt help you, open a new project with the same name as the imported project,after you do that, go to the Original project,open it and selcet all files with ctrl+A,and than copy paste it inside the new project,then click yes to all inside the alaert and it should work.

如果所有的解答上面没有帮助你,打开一个新项目名称相同的进口项目,当你这样做,去原始的项目,打开它和ctrl + a selcet所有文件,然后复制粘贴在新项目,然后单击yes以所有alaert内部,它应该工作。

#9


0  

If none of the above answers help, check the permissions of the folder which contains the projects. In Ubuntu from command line try this:

如果上面的答案都不起作用,请检查包含项目的文件夹的权限。从命令行到Ubuntu,试试这个:

sudo chmod 777 Folder_Containing_Projects -R

The above command will give permissions recursively.

上面的命令将递归地授予权限。

#1


11  

I solved this by importing the project in the following manner:

我通过以下方式导入项目来解决这个问题:

File > Import > Android > Existing Android Code Into Workspace

文件>导入> Android >现有的Android代码到工作空间

Click Next, then Browse...

单击Next,然后浏览…

Select your project root directory, and check the box for Copy projects into workspace. Click Finish.

选择项目根目录,并选中将项目复制到工作区中的复选框。单击Finish。

Hope it will help you.

希望它能对你有所帮助。

#2


8  

I also faced the same problem for long, today only I found out the solution!

我也面临同样的问题很长时间,直到今天我才发现了解决方案!

It's all lies in .project and .classpath files inside project's root directory. While trying to import any project into workspace, if your project does not gets listed, that means .project and/or .classpath files are either missing or corrupt. Usually these files are hidden, so you never know what is the issue.

它们都位于项目根目录中的.project和.classpath文件中。当尝试将任何项目导入到工作区中时,如果您的项目没有被列出,这意味着.project和/或.classpath文件要么丢失,要么损坏。通常这些文件是隐藏的,所以你永远不知道问题出在哪里。

For Ubuntu, follow steps below:

对于Ubuntu,请遵循以下步骤:

step 1. go to any project root directory in your workspace and press Ctrl+H to see hidden files.

步骤1。转到工作区中的任何项目根目录并按Ctrl+H查看隐藏的文件。

step 2. copy .project and .classpath files from there and paste to the other project directory that you wanted to import.

步骤2。从那里复制.project和.classpath文件,并粘贴到要导入的另一个项目目录。

step 3. Open the .project file and update name tag to project name.

步骤3。打开.project文件并将name标记更新为project name。

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
 <name>Name of the project</name>
 <comment></comment>
 ....

step 4. close the folder and import the project, it will be definitely listed in the import wizard now!!

步骤4。关闭文件夹并导入项目,它将会在导入向导中列出!!

#3


3  

I also encountered the same problem.

我也遇到了同样的问题。

you need to update ADT (Eclipse Plugin) to work with new Android SDK.

您需要更新ADT (Eclipse插件)以使用新的Android SDK。

click Help > Check for Updates

单击帮助>检查更新

after ADT updated, you can import your project from File > Import

在ADT更新后,您可以从文件>导入项目

#4


2  

Make sure to check to see if the AndroidManifest.xml file is present in either the folder or a sub folder. You must have that file in order to import.

请务必检查一下是否显示了android。xml文件存在于文件夹或子文件夹中。为了导入,您必须拥有该文件。

This is the issue I had. Luckily I have the unlimited history feature in DropBox so I was able to use that to get the last existing version of the file. Once I added it, importing worked just fine.

这是我的问题。幸运的是,我在DropBox上有无限制的历史功能,所以我可以使用它来获取文件的最后一个现有版本。一旦我添加了它,导入工作就很好了。

#5


1  

I'm facing the same issue, here what i have done. - In Eclipse, Go to windows -> Preferences - choose Android, set your Android SDK Location make sure you have at least one of the Android platform in the table. - Apply and Ok.

我面临着同样的问题,这就是我所做的。-在Eclipse中,转到windows ->首选项——选择Android,设置Android SDK位置,确保表中至少有一个Android平台。——应用和好的。

done, I try import, and it's fine. Hope it help.

完成后,我尝试导入,没问题。希望它帮助。

#6


1  

It could be that the project already exists in the workspace. The solution is to either change your workspace location or just rename the project you're importing.

项目可能已经存在于工作区中。解决方案是要么更改工作区位置,要么只是重命名正在导入的项目。

#7


0  

After importing the file, you can deselect the in library from properties section. It worked for me

导入该文件后,您可以从properties部分取消对库的选择。它为我工作

#8


0  

if all the sulotions above didnt help you, open a new project with the same name as the imported project,after you do that, go to the Original project,open it and selcet all files with ctrl+A,and than copy paste it inside the new project,then click yes to all inside the alaert and it should work.

如果所有的解答上面没有帮助你,打开一个新项目名称相同的进口项目,当你这样做,去原始的项目,打开它和ctrl + a selcet所有文件,然后复制粘贴在新项目,然后单击yes以所有alaert内部,它应该工作。

#9


0  

If none of the above answers help, check the permissions of the folder which contains the projects. In Ubuntu from command line try this:

如果上面的答案都不起作用,请检查包含项目的文件夹的权限。从命令行到Ubuntu,试试这个:

sudo chmod 777 Folder_Containing_Projects -R

The above command will give permissions recursively.

上面的命令将递归地授予权限。