Opening existing project from source control

28,581

Solution 1

There is a bug in Eclipse what won't let you create an Android project from existing sources:

http://code.google.com/p/android/issues/detail?id=8431

You have to move MyProject to a folder that doesn't have any other projects in its sub-directories. You can then make a new project from existing source with MyProject. Remove the new project from the workspace without deleting the contents on disk and move it back to your Android folder. Now do an Import -> General -> Existing Project into Workspace, and MyProject should be available to import.

This is the only way I've been able to do it.

Solution 2

Ok, I'll try to sum it up, after I faced similar problems and wasted some time:

Eclipse Juno /4.2 SR1 (however I think it is a general misunderstanding of how eclipse imports projects)

  1. If you want your new project "connected" to git/mercurial, you'll have to clone and import via "Import/Git/Import from Git"
  2. It will fail if your "workspace dir" equals the "local destination dir". A git clone via egit MUST NOT be placed! in the "eclipse workspace dir"!

The project import will fail because the projectname in the cloned ".project file" already exists in the eclipse workspace dir when the import occurs.

Share:
28,581
Andrew
Author by

Andrew

I’m altogether introverted, cynical and peevish, but despite my laundry list of irritations I’m typically upbeat and laughing. I enjoy classic rock, dystopian novels, golf, playing guitar, and hobby hopping. If you’re looking for me outside of work hours, I’ll probably be at the driving range. I’m a novice software developer, but have an unwavering motivation to bring innovation and quality to software products. I’ve assimilated a strong understanding of a software product’s development cycle, enjoy addressing new challenges and using new technologies, and am passionate about the development of software products that make a difference.

Updated on July 09, 2022

Comments

  • Andrew
    Andrew almost 2 years

    I've been pushing my source to a Mercurial repository. Today I needed to delete my local copy and re-clone. I did this by simply moving my local copy somewhere else (just in case) and typing "hg clone url".

    This part has worked just fine.

    However, when I try to pull the newly cloned local copy into Eclipse, I get the following error:

    /Users/Andrew/Dev/Workspace/Android/MyProject overlaps the location of another project: 'MyProject'
    

    My guess is that I have been committing some meta file or something that I shouldn't have. Does anyone have any ideas? Here is my .hgignore:

    syntax: regexp
    \.DS_Store
    .swo
    .swp
    .metadata/
    /bin/
    

    Note: Looks like my hgignore is not blocking the gen folder. Could this be part of the problem?