315

I am trying to import a project that me and my co-worker have been working on.. and keep getting this error after I select-- "import" then "import existing project" then click archive file, and then I click next, and this error comes up:

Some projects cannot be imported because they already exist in the workspace

Liam
  • 27,717
  • 28
  • 128
  • 190
Kelley Duran
  • 3,151
  • 2
  • 15
  • 3

40 Answers40

355

Uncheck the "copy projects into workspace" checkbox, and then click "refresh" button, you will be able to import the project

Marek Sebera
  • 39,650
  • 37
  • 158
  • 244
rekinyz
  • 6,576
  • 2
  • 29
  • 32
  • 11
    Does not help in Rational Application Developer. – Sarah Vessels Apr 24 '12 at 13:25
  • 4
    I think if the project already exist then it dosent work. but if the project is deleted and you want to import it again and for some reason it need refreshed then it might work. Any way for me it didn't work. – Dr. Mian Jun 27 '12 at 18:35
  • 4
    Works for me. It is very easy to run into this problem if you copy the project into your workspace ahead of time and then try to import it. – TrentCoder Nov 26 '12 at 04:19
  • 4
    doesn´t work in all cases, it´s better to rename one of the two. – Sebastian Juarez Dec 20 '12 at 07:34
  • Yes I am able to do that, but the project seems to be devoid of all its settings, i.e. it doesn't even know what type of project it is supposed to be building, and I can't see any way to rectify that. Looks like I have to rebuild the project from the source. – CashCow Nov 01 '13 at 10:42
  • Worked for me--I knew about unchecking "copy to workspace" but I had not noticed the Refresh button. My use case was to check out a project from svn and then have Eclipse register it as a project. – gbarry Jan 21 '14 at 19:06
  • @ArisRe82 No it shouldn't. I have my "copy projects into workspace" option disabled by default, and it still prevents me from importing a 1 for 1 copy (in Eclipse v4.4.x) – arkon Oct 01 '14 at 17:09
  • 1
    Where is this option "copy projects into workspace" in Eclipse – Saras Arya Feb 16 '15 at 09:51
  • 3
    No longer working for me with latest eclipse :(. \n anyone has an idea how to solve this? pretty frustrating. – Fisher Coder May 21 '16 at 00:54
  • Mine is not checked. I still have this error. This does not work in common cases. – yellowjacket05 Dec 02 '16 at 02:35
  • I dit it and works for eclipse neon. I did exactly the same wihtout any refresh – karlihnos Jun 01 '17 at 12:36
  • I found going to File > Open project from file system, worked for me. – C.Gibby Apr 02 '19 at 22:29
  • Doesn't work in eclipse. – Ashu Phaugat Dec 11 '21 at 19:14
132

go to .project file in your project and change the name of the project in name tag

zishan
  • 1,461
  • 1
  • 13
  • 12
  • Excellent that works, additionally if you have inner project dependencies - you need to check each one of it on 'Build Bath' and update the Project entries -on the Required Projects section – javapapo 1 min ago – javapapo Oct 10 '12 at 12:29
  • This helped me... I wanted to copy a project from a repository, import into Eclipse, change all the references in the project to reflect the new name, then create a new repo for it. (I did not want to branch) At this point, I'd get an error saying "Resource OldRepo\" already exists. .project isn't listed in the Package Explorer, so I didn't think of checking it. I changed the name to match the projects new name, restarted Eclipse, and then I was able to start the new repo. – strangeluck Jun 10 '13 at 17:07
  • I am unable to find this .project file. Where can I find it? –  Mar 14 '14 at 19:49
  • @FarazAhmad Uhhh...in your project folder – arkon Oct 01 '14 at 17:13
  • @StacyM Because you aren't doing a standard import. You're using the `Existing Android code into workspace` option. Even if it *is* an Android project, use `General > Existing projects into workspace` – arkon Oct 01 '14 at 17:16
  • I have the same issue . So here is what I did but still no luck 1. I created the new workspace and tried to import. But I still see the same issue 2. I renamed the project name in .project file and tried to import , still i see the same issue . 3. I dont see any projects under Project explorer. What actually is the problem ? Can anyone let me know pls – pranathi Nov 22 '16 at 16:14
  • I made a copy B of an existing eclipse project A since I want to modify B but leave A unchanged. To import B, I had to change the name as per this answer. – drlolly Apr 17 '19 at 07:39
  • Also we need to change these two tags in pom.xml and – amresh tripathi Aug 03 '23 at 05:01
60

It has just happened to me too. Finally I realized that the project was already open in my workspace but it was not visible because of the selected working set. You have just to deselect the active working set and all opened projects will become visible.

Pino
  • 7,468
  • 6
  • 50
  • 69
  • 8
    Do this in either the Project Explorer or the Enterprise Explorer view. In the view, click the little down-arrow to open a menu, and choose Deselect Working Set. This worked for me, and my project that was already there that wasn't showing up now shows up. – Sarah Vessels Apr 24 '12 at 13:30
  • I'm new to Eclipse. After importing and clicking Finish, it seems nothing happens, but Project imports. You have to click on the Project Explorer icon to have it display. – StacyM Jan 18 '14 at 17:52
  • This was the solution for me. I also had another problem, my projects were marked as loaded in eclipse but couldn't open so if you see blue folders with nothing in them remove them. Only thing I don't get is why is this not simpler, you should be able to set input folder,output folder and project name and eclipse should do the rest. If you try changing any of those manually Eclipse will bug out... – Igor Čordaš Jun 18 '14 at 14:20
  • When I copied my workspace to a new machine, it got confused about working sets and so some projects did not show up in the "Package Explorer", but did show up in "Navigator". But after tweaking working sets, they showed up again. – Dale Feb 27 '15 at 01:11
30

This usually happens when you change the project directory physically without first delete in Eclipse. You can view and delete these hidden projects in the following view:

Window -> Show View -> Other -> General -> Navigator

Then simply just continue with the process of import existing project.

Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
lopes
  • 549
  • 5
  • 13
  • Its very clear from the question that another project with the same name exist, how can you rename while importing? I think this is the question! – Mohy Eldeen Dec 15 '16 at 16:41
  • This worked for me . I had deleted the project from my workspace ,but due to some command prompt was opened in the project directory it was not completely removed from workspace, so I closed eclipse and manually removed remaining files from disk but this delete was not reflected in eclipse workspace but it was not showing in normal project explorer window so I could delete it. So this solution shown me non deleted project in eclipse, then I deleted it again and then imported newly cloned project. Its done. – Anonymous Mar 12 '20 at 18:38
  • navigator is deprecated in my eclipse, i can't open it anymore :( – aholbreich Mar 18 '21 at 15:04
21

In my case, I copied one of the projects (say 'Project1') from the workspace and pasted it to the same workspace. After that I modified the name of the pasted project (say to 'Project2'). I could not see it in the repository.

The main reason was .project file from the new project still had: <name>Project1</name> instead of <name>Project2</name>.

So, I did following things in order to get the issue fixed:

  1. Cut and paste Project2 outside the workspace
  2. Change .project file to have <name>Project2</name>
  3. Try importing Project2 again.

It worked for me.

Vikram
  • 3,996
  • 8
  • 37
  • 58
20

You may have a project with same name in your workspace. Try to refresh (file->refresh) your workspace after deleting the another one with same name. A typical situation occurs when you want to re-import a deleted project.

David Eyk
  • 12,171
  • 11
  • 63
  • 103
ArK
  • 20,698
  • 67
  • 109
  • 136
14

Projects in the Eclipse workspace must be unique. Note though that the project name need not be the same as the directory/folder name of the project, so you can either delete any existing project with the same name or alternatively rename the existing projects.

Tonny Madsen
  • 12,628
  • 4
  • 31
  • 70
11

Maybe you get the same project name in your '.project' file,check it,if yes, rename another name.than import again

tyler
  • 111
  • 1
  • 2
11

You have one occult directory named ".metadata" in workspace directory. Close Eclipse, delete ".metadata" and open Eclipse. When eclipse ask you about workspace make sure that ".metadata" isn't in workspace directory and click "ok" button to select default workspace.

barbas
  • 135
  • 1
  • 2
  • 4
    It works, but on the other hand, once you delete .metadata, everything will be remove from the Eclipse workspace. This includes the existing projects (if you have more than 10 project, you will need to import all of it back =( ). In addition, the theme, colors etc will be remove at the same time. – Lee Yi Hong Jul 01 '14 at 08:58
  • 4
    DO NOT DO THIS BLINDLY. It does work, but backup the .metadata folder first instead of deleting. You do have to import every project manually. There must be some more focused way to just delete the one project from the .metadata instead of deleting all projects. I had deleted a project from the workspace that was causing this error when I tried to reimport a modified version of it in the same location. – CodeMed Oct 15 '14 at 00:07
  • 3
    This is a terrible suggestion for the average user. Don't mess with .metadata unless you have a very good feel for what it does. And anyone with that level of Eclipse expertise won't need to do it to solve this problem. – Erick G. Hagstrom Apr 02 '16 at 16:58
10

If you've arrived at this because you have cloned a git project into the existing workspace and now you want to promote that workspace to a full fledged project then you should use the 'Git Repositories' view -> select 'Working Directory' -> Import Projects -> Existing projects.

ambicoder
  • 101
  • 1
  • 2
9

Check if you have configured Eclipse to show ALL the working set. I once encountered exactly the same problem and it turned out I accidentally imported the project into the Other Projects working set. And my Eclipse configuration didn't show that working set in the package explorer, which lead me to believe that the project was not imported yet.

Updated for @Mawg:

First, click the Select Working Set...:

enter image description here

Then, choose No Working Sets:

enter image description here

This will effectively disable the working set and show all projects.

smwikipedia
  • 61,609
  • 92
  • 309
  • 482
9

Try to rename the value of <name> tag which inside ".project" file of your project.

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>Rename this value</name>
    <comment></comment>
    <projects>

This will work for sure. Here you are just renaming your project.

Toothless
  • 359
  • 3
  • 7
  • 17
7

EASIEST WAY: Right click on the project (folder that reads "MainActivity") go to Refactor -> Rename and you will get a text field allowing you to rename your project.

If you get an alert saying your project is out of sync with the filesystem press F5 (refresh) and try again.

Stunner
  • 12,025
  • 12
  • 86
  • 145
6

In my case i had deleted the resources directory from my .metadata.plugins:

  1. Go to your workspace
  2. Enter .metadata.plugins
  3. Delete : org.eclipse.core.resources directory

enter image description here

Monsif EL AISSOUSSI
  • 2,296
  • 19
  • 17
6

Take a look in your workspace folder, you may have an old project there with the same name as the one you are importing (even though it's not being shown on eclipse).

When you delete a project on Eclipse, if you don't check the checkbox on the dialog, it just removes it from the view and doesn't delete the folder on the workspace directory.

everton
  • 7,579
  • 2
  • 29
  • 42
5

Another way I just found!

MOVE the project to some other folder and then import and if required copy to workspace

madhairsilence
  • 3,787
  • 2
  • 35
  • 76
5

I had this issue when I deleted a project and tried to import the code again. Eclipse never really deleted the project and still held a reference to the project name/folder in the workspace. I had to created a new project with the same name and my code appeared as it was. I believe this only worked because the project path was never changed.

Fydo
  • 1,396
  • 16
  • 29
5

It was happened to me when

I delete project from eclipse Project Explorer and not checked the remove content from disk.

Next time when I tried to import same project in workspace then got same problem.

To solve I just did FYI work that every kid can do :)

So How I solved it:

  1. Cut Ctrl + x myProject folder from eclipse workspace to other location ie Desktop
  2. Right Click Navigator (you can get it from Window > Show View > Navigator) and Refresh (it will prompt following dialog) enter image description here
  3. Just click Yes button and move your project folder back to eclipse workspace directory
  4. Import again!
  5. Now Rock 'n' Role
mumair
  • 2,768
  • 30
  • 39
5

This warning means you just deleted project from navigator, but the project is present in the working set. Or else your working set has project with same name, so go to work-space directory and delete the project which has the same name and import again.

pooja patil
  • 291
  • 1
  • 8
  • 20
4

In eclipse click file then select switch workspace then browse and select another folder. Now repeat the same process and this time there will be no error :)

Dr. Mian
  • 3,334
  • 10
  • 45
  • 69
4

I had a similar problem, I have the same repository I wanted to import twice. I renamed the existing project by right clicking on the project > refactor > rename then imported it again.

Mark Howard
  • 526
  • 4
  • 13
4

My problem was a little bit different.

For example, the project name (what I see) was FooProject and in the imported project, I was looking for the FooProject but I could not. However, Eclipse does not let me import that project because he claims that it is already imported. And then, I have looked at the .project file of the project and I have seen that the actual name of the project was not what I see (FooProject).

The conclusion; The name of the project (what you see in Eclipse) may be different than the actual name of the project (what maven see). Because of this reason. Please be sure that they are the same name by checking .project file of the project.

Ad Infinitum
  • 3,560
  • 27
  • 33
4

Go to file ---> switch workspace .It will work

Sidhartha
  • 988
  • 4
  • 19
  • 39
4

This worked for me.

File > New > Android Project > Create project from existing source

Location = the location of the project you want to import.

You will get a warning "An Eclipse project already exists in this directory. Consider using File > Import > Existing Project instead." But you will be able to click "Next" and the project should in effect be imported.

Matt
  • 774
  • 8
  • 16
3

Nothing about could not solve my situation. This is how I solved.

  1. Close the IDE
  2. Remove the same name project form workspace
  3. Start the IDE
  4. Clean all project (not sure this helped)
  5. File > Import > Existing Project
  6. click refresh button
  7. import project

Done..

Ruwantha
  • 2,603
  • 5
  • 30
  • 44
3

At least on Eclipse Juno, you can toggle on Advanced. Then select [groupid].[artifactid] from the Name Template dropdown. That should make your project uniquely named. (If you keep multiple versions of a given artifact, you can select [groupid].[artifactid].[version] instead). Be sure to click the Refresh button so the changes are visible. Wash, rinse, repeat as needed.

Saish
  • 1,518
  • 1
  • 12
  • 21
3

delete it from eclipse......u might have closed the project in eclipse by "(Rightclick)-->close project".....so even if you delete this project from workspace folder....it stays there in eclipse IDE as closed project.....you should delete it from Eclipse IDE...!!!

Melbourne Lopes
  • 4,817
  • 2
  • 34
  • 36
3

I have a slightly different situation whereby my eclipse stops responding and I have had to kill the session. After restarting Juno, then the particular project I was working on disappeared although .project file exists. Trying to import back into Eclipse would yield the same "Some projects cannot be imported .." or "A project with this name already exists" if trying to create a new project.

In the end, since I was using Working Sets, I managed to find this file .metadata.plugins\org.eclipse.ui.workbench\workingsets.xml. Manually added the missing entry and restarted eclipse and voila, it came back.

hwase0ng
  • 84
  • 2
3

I had the same error because there was one more project under svn in workspace but with another name. So I've removed it.

Yuliya Tarasenko
  • 437
  • 2
  • 19
3

This is what i have noticed for the above issue :- If the checkout folder (folder where your pom project resides) is same as the eclipse workspace folder then i am getting this issue

SOLUTION

when i used a separate workspace folder for importing the project, eclipse did worked smoothly :)

Soumyaansh
  • 8,626
  • 7
  • 45
  • 45
3

In case you are using Maven, make sure that your artifactId in pom.xml does not have the same name as any existing project name in your Eclipse project explorer.

Yuci
  • 27,235
  • 10
  • 114
  • 113
2

This problems occurs because you have the same project in some other project folder.As in eclipse we have many project folder, So if you have a project in one folder and you want to import it in other project folder, then this problem occurs. So first of all DELETE the project from other folder and then import in into your current one project FOLDER.

Pir Fahim Shah
  • 10,505
  • 1
  • 82
  • 81
2

New to Eclipse and Android development and this hung me up for quite a while. Here's a few things I was doing wrong that may help someone in the future:

  1. I was downloading code examples and assuming project name would be the same as the folder name and was looking for that folder name in the project explorer, not finding it, re-importing it, then getting the error message it already existed in the workspace. Yeah. Not proud of that.
  2. Didn't click on 'Copy projects into Workspace' and then searched in vain through the workspace when it didn't appear in the project explorer BECAUSE
  3. The 'Add project to working sets' option in the Import Projects tab isn't working as far as I can tell, so was not appearing in the project explorer for the active working set (refresh made no difference). Adding project to the working set had to be done after successfully importing it.
resedasue
  • 434
  • 5
  • 14
2

I found this after two days of efforts.
It is worth trying.
FAQ

Kishor Pawar
  • 3,386
  • 3
  • 28
  • 61
2

It is very simple.

press f2 key to rename project .

and import multiple copy of android projects with the same package .

Ashish Saini
  • 2,328
  • 25
  • 21
2

If the project has been already deleted from the project navigator, then right click in project navigator, and select refresh to refresh the workspace. Then re-add the deleted project.

Davis
  • 51
  • 3
1

I built the eclipse dependencies in the project terminal and then tried to import the project and it worked.

user4948761
  • 129
  • 1
  • 5
0

Try uncheck the option Copy projects into workspace.

It works for me.

Avin Shum
  • 446
  • 6
  • 5
0

I just had the same problem and the solution that worked for me was simple.

Click on "File" -> "Open Project from File System" -> Next to import source, click on Directory and browse for the root of your project. Highlight it, then click on "Select Folder" Then click on choose folder, Next I clicked on "Finish".

Kyle Heath
  • 13
  • 4
0

Editing the file .project does not work for me, even if a unique name has been chosen.

Many of my Eclipse projects are in sub-folder "trunk" - of course with totally different paths. In this case if a project named "trunk" exists already, new existing projects cannot be import no matter how the names in .project are changed.

Just rename the "trunk" project will solve the problem. And the newly imported projects are using the names specified in the file .project.

chance
  • 6,307
  • 13
  • 46
  • 70