28

What is the Android Studio equivalent of Solution file in (.sln) file in Visual Studio ? I created a project in Android studio and closed it. Now I am not sure which file should I open to reload it into Android studio.

12 Answers 12

16

Use the import project function on the build.gradle file in your project root (not the folder itself!) to open the project again in Android Studio.

6
  • 6
    Thanks for the answer. But my question is about opening the project in Android studio not importing it. For example I am looking for an action like double clicking the .sln file open a project in Visual Studio. Similarly is there a file which I can use to open up the whole project in Android Studio ? Jan 3, 2014 at 15:27
  • 2
    There probably isn't such a file, just as the project.properties file Eclipse uses doesn't start Eclipse. I think it's rather an exclusive feature of Visual Studio. The 'normal' way is just to start Android Studio and it will load the last project automatically, or use the way described in my answer.
    – nhaarman
    Jan 3, 2014 at 15:31
  • 1
    But that doesnt work when we zip the file and take it to another PC. Sorry I am coming from a VS background, and it seems simple with VS. Jan 3, 2014 at 15:40
  • 1
    Then you would import the project as I described.
    – nhaarman
    Jan 3, 2014 at 15:44
  • 1
    does this mean one has to import the project every time? I likewise am hunting for it :) if it is like intellj idea it uses a folder called ".idea" which will only show up with "ls -a". In the case of intellij '.iml' is for "modules" whhich are sub parts of a project that might do something like make a single jar file from source, and there are multiple modules in a project.. I likewise had a partner check in his project and am trying to figure out how to open it or figure out if he didn't check it in :)
    – peterk
    Jun 12, 2015 at 1:00
4

I think ".iml" is the extension for Android studio projects. ".project" is for Eclipse projects

6
  • But opening the .iml file throws a dialog saying "no project found to open file in". But then it opens up the project. But this is same with any file on the root folder. Basically its not clear which is the right file to open to load the project Jan 3, 2014 at 15:30
  • You're right when you said it's not clear. I usually load my projects using the "Recent projects" menu item
    – Aerilys
    Jan 3, 2014 at 15:31
  • 1
    Problem is when you zip the project and take it to some other system. Recent projects may not help you in that PC Jan 3, 2014 at 15:39
  • In this case you can simply create a new project on your other system, by using the same sources. Since the build should be done on the Gradle file, it's not an issue imo.
    – Aerilys
    Jan 3, 2014 at 15:40
  • 5
    Thanks for the answer. It would have been good if AS provided a way to open the file like in VS its simple and intuitive. Jan 3, 2014 at 15:44
3

Opening a saved project on another drive There is no such single project file that needs to be opened but rather the directory where the whole project is stored.

  1. Find the directory where you have saved your project
  2. In Android Studio -> Files -> Open->(click on the directory name where your files/project is stored)
1

Except using android studio unique method(import), you can also double click .iml file to open corresponding project.

If you using Windows operating system, you could right click .iml file in file explorer, and select studio64.exe to open it, then android studio start the project!

0

At least in the version I have, like intellij the "android studio project files" are stored in a folder called '.idea' in the root of your workspace (though you can explicitly create one that looks up the tree and have it not be in the root).

If you add this folder to source control, do not add the file "workspace.xml" as that is the state of the window positions on your machine and should remain local, checking it in will cause lots of confusion.

If this directory is present, android studio will give the containing folder an android studio icon in it's open file browser window in the windows version. You can click on the directory with this icon in intellij (android studio) and open the project.

0

In Windows, Click at projectname.iml under project directory root. If window is not does not have the .iml file association with Android Studio, you need to add it.

0

When you select File->Open in Android Studio and navigate through folders, you will notice that folders which consist valid Android projects would have the Android Studio icon, clearly indicating that this is all you have to select.

It is unusual approach in terms of normal behavior of programs under Windows, because since very first versions of Windows it's become accustom to be able to open a program by double-clicking on the file associated with such program, but I guess developers of Android Studio decided not to do that.

It is possible that ".iml" file could be associated with Android Studio but it doesn't happen by default and it's not associated on my computer neither.

0

I ran into this problem, after upgrading Android Studio to 3.0 on Mac. The previous projects I had created were not displayed, in the splash screen, during startup of 3.0, so what I did was: 1. Pick the option to Open a project 2. Navigate to the location where the project was previously saved (~/AndroidStudioProjects/projectFolder) 3. Select the folder (don't double-click it) 4. Click button: Open 5. Result: this opened the project. So there is no need to select any particular file. I suspect the filer of this problem was double-clicking the project folder and then wondering what to select next, which is what I did, initially. But it turns out that the Open button is required, in order to open the project. Otherwise, Android Studio anticipates that your intention is to open the folder.

0

.iml file can be used to open the project directly into Android Studio (I am referring to Android Studio 3). Just goto your project folder and then double click on yourProject.iml file.

0

I know its late but better late then never :-)

Visual Studio uses one solution file. Android Studio does this different. It uses a directory for this purpose, namely the directory .idea in your project. In this directory several files make up how your IDE is configured for that project. The same as in Visual Studio. Those files can be edited and changed, but you will have to know what is what in those files.

0

It's .iml, however, it varies. If you go in the root of your Android Studio project, you will see it specifically.

-1

I think the answer is .duh

Please see screenshot:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.