How to open an existing Android project in Leda (Intellij 12)

I have created a new android project in Leda and now I m trying to open it by going to "Open Project" option and pointing to the .iml; Nothing happens.

4 comments
Comment actions Permalink

*.iml are modules files, not project. You need to open either the .idea directory or the .ipr file. Both will show in the File Chooser (for open project) as the IntelliJ IDEA icon icon_small.png.  The .idea directory is the newer directory based project settings/configuration storage method (and the default for new projects) and the *.ipr file is an older (but still possible) file based project settings/configuration storage method. By default, IDEA will put the .idea directory (or the .ipr file) in the project's root directory. But it is possible to place it anywhere on the hard drive. So it is possible you inadvertently modified the setting of where to place it. If it is not in the project's root, look up the tree a directory or two.

<edit>
Also look in recent projects list for it: File > Reopen...

0
Comment actions Permalink

Mark,

The only file I see is the .iml for the Android project. There is no .ipr or .idea. The recent history doesn't have the proejct that I want to open and thats why its more frustrating. I think either its too simple and I am missing something or in Leda there is no easy way.

0
Comment actions Permalink

incperi wrote:

Mark,

The only file I see is the .iml for the Android project. There is no .ipr or .idea. The recent history doesn't have the proejct that I want to open and thats why its more frustrating. I think either its too simple and I am missing something or in Leda there is no easy way.

Just to be check, are you sure you created a New Project and not a New Android Module within another project? It sounds like that may be what happened. (If you open your other projects, I suspect you will find the android module attached to one.) Either way, you can easily create a new project to work with that module (.iml file). Do the following:

  1. File > New Project
  2. Select "Create a Project from Scratch" and click Next
  3. On the next "New Project" dialog
    1. give the project a name.
    2. pay attention to the "Project Files location" text field. This is where the project will be located.
    3. I recommend leaving the default project format of ".idea (directory based)"
    4. Uncheck the "Create Module" option
      • Typically this is where you would select to create an Android Module (or Java module, or whatever). But since you already have one, we'll just add it to the project after we create it.
  4. Click Finish
  5. After the project opens, go to the "Project Structure" dialog (File > Project Structure). Since you did not create a module, this should open automatically.
  6. In the "Project Structure" dialog, with the "Modules" option selected in the left pane, click the add icon add.png
  7. On the "Add Module" dialog, select the "Import existing module" option. Use the browse broswe_select_ellipsis.png button to locate your .iml file
  8. Click Finish


You should now be all set.

Normally working with projects in IDEA is easy. So I would encourage you not to get discouraged. The one concept to get use to is a project vs a module. A project has 1 or more modules. A module technically can be opened in multiple projects (although you would typically not want to do such at the same time.) But having a module assigned to multiple projects is something I would not recommend until you are more familiar with IDEA.

0
Comment actions Permalink

p.s. the other possibility it the .idea directory (or .ipr file) is in a sibling directory. In the New Project dialog, when you enter a name for the project, IntelliJ IDEA auto edits the path for the "Project Files Location". Sometimes while editing the project name (or if you go back and edit it after changing some other values) you can inadvertently place the project files location somewhere strange. I've done that a couple of times over the years.

0

Please sign in to leave a comment.