I have a problem with importing Android project to Eclipse in three scenario:
I have clone my Android project from Bitbucket and synchonized with Eclipse workspace successfully! But the project raise many error.
Then I remove my project and using import function in android (File>import project). I import the project from repo and also check to 'copy project into workspace', awesome! the project work perfectly.
Then I testing again. I also use import function and not check on 'copy project into workspace', oh no, the project keep the error like scenario 1.
We've always had this issue - however, we face it in P4 SCM.
I guess the problem would be the same, anyway - your project may not be detected as an Android project.
First create a new Android Project. Now, go to Navigator in Eclipse (Window -> Show View -> Navigator) and open .project file - copy it's contents and paste in your (imported) project's .project file. This should fix it.
Make sure to make the required changes (the project name is the only change we usually make) after copying.
I accidentally deleted a completed project of mine from eclipse. The deleted project is still in my workspace folder. I tried to import it in to eclipse by clicking, File -> Android -> Existing android code in to workspace. I had checked my data in the project folder, before importing it in to eclipse by opening it in notepad. The data was all there then. But after i opened it in eclipse, the data is all lost. The java files and xml files are there, but with no codes inside. It is all 0kb. Is there any solution to recover it back ?
easiest way..
start a new workspace and do an android project import of the project form your first workspace.
In future yo should get use to the git dev flow which would be to set up the project in another folder rather than the eclipse workspace..other benefit is that whenever you update Eclipse versions workspace etc you still have a non corrupted subfolder with all your pojrects in it.
I'm following this guide:
https://stackoverflow.com/a/10888882/1943607
Follow the steps below to add HoloEverywhere
Download Zip from GitHub to your computer UnZip the folder Go to
eclipse and choose File->New-> Android Project
Select Create project from existing source and then browse to the HoloEverywhereLib folder
inside extracted folder
Press Finish
Right click on the newly created project and go to Properties. Under the Android heading, you should see a section for Library with a checkbox IsLibrary. Make sure that's checked and press Add and previously added library ActionBarSherlock.
I unzipped the folder. Then went to eclipse -> Right click -> Import -> Android -> Existing Android Code into Workspace.
I select the unzipped folder and It's showing this:
When I click Finish:
And then if I create a new project, and try to import it, It cant find the library; I type org. and it isn't showing up the rest (org.holoeverywhere.app.***Activity). (Like its github says https://github.com/Prototik/HoloEverywhere#how-to-use-maven)
Can you help me out?
Edit: I've also tried to remove src from .classpath files with same result
Clone the repository using Github desktop. Install eGit on Eclipse. Then use import-->Git-->Projects from Git.
I erased a project from the Project Explorer, because I didn't think I had everything in the Workspace folder that it needed. I was getting error messages. When I got the complete project into the workspace folder and tried to re-import it I get this message: "Some projects cannot be imported because they already exist in the workspace."
The three folders of the project show up in the window, but are greyed out and cannot be selected.
Thanks to Arun and Francis below.... but new problem
OK. Great! Got passed that one deleting from hard disk and creating a new workspace folder. But now when I try to run it as an Android Application I get the message, "No compatible targets were found. Do you wish to add new Android Virtual device? And in the Console: "Failed to find an AVD compatible with target 'Google APIs'." I'm really new to this so thanks for whatever patience you have to answer newbie questions.
Try back up your project folder and delete the project completely from project explorer and from the hard disk. Make your backed up project folder into a zip file and try re-import it and recreate a separate project copy in your workspace. If this doesn't work, try switching workspace...... :)
So it sounds like the project is still there in the workspace, so try deleting it again. When you delete it, make sure you select the option "Delete files on the disk", this will actually remove the underlying file in addition to just removing the project definition from the workspace.
If you still have trouble (that is, the project is still there), delete the files from the workspace associated with the project by hand (in the operating system). And then Refresh the project and try deleting it from the workspace again (don't select the option to delete files on disk). It should be gone then.
Once the project is gone from the workspace and the underlying files are gone, try your import again.
If you use working sets, make sure they are all deselected. Only the projects from the current working set will display in Project Explorer. By having no working sets selected you can see all the conflicting projects in Project Explorer and delete them by hand. Then re-import.
I'm trying to import and existing Android project into my current Eclipse workspace. I select File->New->Android Project, which brings up the Android project dialog, I then select, "Create project from existing source", Location, Build Target and Finish.
I get the following error: Invalid project description.
Does anybody know how to get past this error?
File → Import → General → Existing Projects into Workspace → Next
Select root directory: /path/to/project
Projects → Select All
Uncheck Copy projects into workspace and Add project to working sets
Finish
Solved: If you want to "Create project from existing source", you need to create a new directory and then put the project directory tree into that new directory. Then point to the new directory when importing.
This error message appears when the source code you try to import is inside an existing workspace.
Put your source code in a directory OUTSIDE any existing workspace and then import
Just delete the ".project" file in your project folder (it's hidden on Linux, use "ls -a" to show), then from Eclipse, choose Create Android Project from existing source
Im not sure this will solve your problem since I dont know where it originats from, but when I import a project i go File -> Import -> Existing projects into workspace. Maybe it will circumvent your problem.
It seems you cannot have your project root, with the AndroidManifest.xml deeper than one directory level below your workspace root. I struggled for an hour with this before I just gave up and rearranged my repo.
You can also use Make new > General > Project, then import the project to that project directory
I found James Wald's answer the closest to my solution, except instead of "File->Import->General->Existing Projects into Workspace" (which did not work for me at all) I used "File->Import->Android->Existing Android Code Into Workspace". I am using Helios, maybe your version of Eclipse does not have this quirk.
I had the problem of getting errors when checking out an Android project from SVN. This is what I did and the whole thing settled down.
1. checkout the project from SVN as we normally do any other project
2. right click and get properties of the project
3. In the java build path->order and export tab select the android API and OK it
this removed all the project issues
so far so good but not sure if this is the 100% correct method
This post helped me: http://code.google.com/p/android/issues/detail?id=8431
In my Android Project folder .project file was missing. Restoring the .project file,which will be hidden in Unix OS environment resolved the error.
Updating #JamesWald's answer, and incorporating other comments. Assuming you want to create a cfesh copy from, say, a backup in your new workspace:
Put the existing project in a directory not inside the destination workspace.
In Eclipse: File->Import->Android->Existing Android Code into Workspace, Next
Select root directory: /path/to/project/from/step/1
Projects->Select All (or not, as the case may be)
Make sure you set the new project name correctly - To change one click on the old project name (left column) and then click on the new project name (right column) and then edit. It will default to the class name of the Default Activity.
Assuming you want a copy in the destination workspace, check "Copy projects into workspace"
uncheck "Add project to working sets"
Finish
Same problem happened to me as well and the .project file was not there in the project.
I copied a .project file from an existing android project and replace the project name with the name of the project I am trying to import.
Then using File -> Import -> Existing projects into workspace I was able to import the project.
What works for me is that: File > Import > Existing Project into Workspace (under General tab), then choose the project root folder. The importing of Existing Android Code into Workspace somehow does not work on Eclipse for me.