How to import existing Android project into Eclipse?

AndroidEclipse

Android Problem Overview


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?

Android Solutions


Solution 1 - Android

  1. File → Import → General → Existing Projects into Workspace → Next
  2. Select root directory: /path/to/project
  3. Projects → Select All
  4. Uncheck Copy projects into workspace and Add project to working sets
  5. Finish

Solution 2 - Android

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.

Solution 3 - Android

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

Solution 4 - Android

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

Solution 5 - Android

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.

Solution 6 - Android

You can also use Make new > General > Project, then import the project to that project directory

Solution 7 - Android

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.

Solution 8 - Android

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.

Solution 9 - Android

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

Solution 10 - Android

Solution 11 - Android

In my Android Project folder .project file was missing. Restoring the .project file,which will be hidden in Unix OS environment resolved the error.

Solution 12 - Android

Updating @JamesWald's answer, and incorporating other comments. Assuming you want to create a cfesh copy from, say, a backup in your new workspace:

  1. Put the existing project in a directory not inside the destination workspace.
  2. In Eclipse: File->Import->Android->Existing Android Code into Workspace, Next
  3. Select root directory: /path/to/project/from/step/1
  4. Projects->Select All (or not, as the case may be)
  5. 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.
  6. Assuming you want a copy in the destination workspace, check "Copy projects into workspace"
  7. uncheck "Add project to working sets"
  8. Finish

Solution 13 - Android

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.

Solution 14 - Android

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionpaulView Question on Stackoverflow
Solution 1 - AndroidJames WaldView Answer on Stackoverflow
Solution 2 - AndroidpaulView Answer on Stackoverflow
Solution 3 - AndroidJames BayleyView Answer on Stackoverflow
Solution 4 - AndroidthucnguyenView Answer on Stackoverflow
Solution 5 - AndroidpgsandstromView Answer on Stackoverflow
Solution 6 - AndroidUllashView Answer on Stackoverflow
Solution 7 - AndroidSebastian BrannstromView Answer on Stackoverflow
Solution 8 - AndroidArthuliaView Answer on Stackoverflow
Solution 9 - AndroidtheraView Answer on Stackoverflow
Solution 10 - Androiduser836200View Answer on Stackoverflow
Solution 11 - AndroidlaaptuView Answer on Stackoverflow
Solution 12 - AndroidNeil TownsendView Answer on Stackoverflow
Solution 13 - AndroidAmbegodasView Answer on Stackoverflow
Solution 14 - AndroidTony VuView Answer on Stackoverflow