Opening existing project from source control
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?
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.
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)
- If you want your new project "connected" to git/mercurial, you'll have to clone and import via "Import/Git/Import from Git"
- 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.
I think the problem is that you moved your local copy away and then you try to add another project into Eclipse at the same location as what you had before and you are just confusing Eclipse...
I would recommend to try to use command line commands for Mercurial and when you get into Eclipse, first clean up existing projects before adding another one.
My sollution was just to import as general
project not an android
one.
I ran into this problem when trying to import a git repo project and it's submodules. I ended up using import -> git -> Projects from Git (git plugin). This understood the concept of a project within a project just fine. The project is now monitored by that plugin. It's a good enough tradeoff for me.
精彩评论