How To Open an Existing project in Android Studio - android

All the questions dealing with this are now outdated. I am simply trying to open an existing Android Studio project.
I have cloned a repository for a project from http://blog.stylingandroid.com/material-part-2/
I have all the files, I choose "Open an existing android studio project" and then choose the "Material" folder which is the root directory of the project. When the project loads, it is called "gradle" and there are no files showing in the project frame.
I am using the latest version of android studio and the latest build tools as of 19 Dec 2014.
How do I import a project?

From the Android Studio welcome screen, try "Import Non-Android Studio project". It sounds like exactly what wouldn't work, but it does.

On 1.5.1, there's no Import Non-Android Studio project as the accepted answer says, but chosing Import project (Eclipse ADT, Gradle, etc.) does the trick. Open an existing Android Studio project does not work. Still quite weird.

Click on file, then click on Open. select the main file that contains the project's name without opening the file.
then Gradle loads but still nothing happens and the welcome screen is shown. press the combined keys of Alt+1 then the project files will appear on the left side of the screen.

Sometimes it is tricky to open Android project. My tip is try to use
File -> Open... -> <path_to_settings.gradle>

Related

Android Studio 3.5 can't open previous version projects

I have a project stored in GitHub, it was created a few days ago using Android Studio 3.3.
I have installed Android Studio 3.5 on a new Windows, and checked out the project to the disk.
When I open the project in Android Studio 3.5, in Android view I only get an empty app item.
The Project view shows all the files yet it seems the project itself isn't loaded.
What should I do to load the week-old project in this very best IDE of great improvements?
Open Android Studio Launcher; or use File -> New -> Import Project
Select "Import Project"
Select project folder
Follow next steps *you understand another
When I have same problem, I use this steps to solve it.

How to create an Android Studio project from a subdirectory in a github repo

I need to create an android studio project from this directory on github. I tried VCS -> Checkout from Version Control in Android Studio, but there is no url for this directory in the repo, so I'm not sure hot to clone just this subdirectory.
I also tried downloading the whole repo, doing File -> New -> Import Project in Android Studio, and selecting the messaging subdirectory as the folder to import. This showed a build progress bar, but after it finished, there was no imported project.
How do I do this?
I am not sure if its the correct way, but i resolved it with the following steps on Android Studio 4.1.1 :
Run Android Studio until the Welcome to Android Studio screen shows up.
Select Get from Version Control.
Paste the URL.
Press Clone button.
This will import the complete repository , but you won't be able to run the app yet (exactly as mentioned in your question) .
Now close and re open Android Studio
On welcome screen, select import Project (Gradle, Eclipse ADT, etc.)
Navigate to the folder where the project was downloaded and select the required Sub-folder
Press OK and let the Studio build your project.
I get it now. Go back to this. Then hit Download Zip and unzip it. In Android Studio go to File -> Open -> then to the quickstart-android-master and then down to messaging. Do NOT open quickstart-android-master go down to messaging and open that.
EDIT
Be aware you will have to follow these instructions to get the project to build and run.
Add google-services.json in android studio

Importing and converting Eclipse-made Android project from Github to Android Studio Gradle-build

I'm trying to migrate from using Eclipse for my Android-project to the new Android Studio, and I'm having an issue related to Gradle.
What I want is for me to push the latest Eclipse-build to Github, and then be able to pull it down in Android Studio, having the latter automatically convert the project to a Gradle-build. If I'm reading the documentation right, the Android Studio import is supposedly able to do this.
When importing, I can choose between "Create project from exisiting sources" or "Import project from external model"
If I choose the first option, the project won't use Gradle (as far as I can see). If I choose the second, it seems to be looking for an already existing gradle buildfile "build.gradle" in my project.
So - Should I download a Gradle-plugin to Eclipse and make a gradle build-file there, or am I doing something wrong in the import?
It seems the only other questions I can find on SO is about importing and Eclipse export or simply how to pull a project from Github in Android Studio.
Thanks :-)
Importing and converting an existing Eclipse project into a Android Studio Gradle project is quite simple :
File -> Import Project (in Android Studio)
Select the manifest of your Eclipse Android project.
Done.
There may be some dependacy management to deal with.
You can also take a look here :
How do you import an Eclipse project into Android Studio now?
How about this:
clone repo to location 1
export from eclipse
import to android studio in location 2
copy the .hg files or whatever's applicable from 1 to 2
commit from location 2 including deleting eclipse files
Now the repo will have the android studio project and not eclipse.

How do I import/build this project?

I am not a dev, but have some dev experience. I have never used Android Studio before but I wanted to look at an example app. I picked one I am very interested in, but it gives me nothing but grief just trying to import it.
https://github.com/AltBeacon/android-beacon-library-reference
Notes:
I am using the latest version of Android Studio. (1.0.2). I have added in all the SDK files needed I think.
I have downloaded and un-zipped Gradle 2.2.1.
I am running Ubuntu 14.04.
I have dealt with Eclipse for Android previously and was able to
hack someone else's code to suit my needs and actually deploy an unsigned apk.
The readme/install directions at the github don't really help a noob
like me.
Install:
I have extracted the project from the Download Zip link.
For the actual import into Android Studio I choose "Open an Existing
Android Studio Project" - because it looks like one.
I then choose the root directory created by unzipping the zip file,
in this case it is named "android-beacon-library-reference-master".
But it seems to select the project's Gradle subfolder (/gradle) for the project! Which I'm quite certain is invalid. I cannot seem to get it to use the root
folder.
What am I missing? Or is this not the correct way to "import" this particular app? Is this app not compatible with AS 1.0.2?.
TIA!
In Android Studio, close any projects currently open. You should see the Welcome to Android Studio window.
1.Click Import Non-Android Studio project.
2.Locate the project you exported from Github, expand it, select the build.gradle file and click OK.
3.In the following dialog, leave Use gradle wrapper selected and click OK. (You do not need to specify the Gradle home.)
Android Studio properly updates the project structure and creates the appropriate Gradle build file.
Can you try "Import Project" instead "Open Project". Thanks.

android studio new project missing folders

I have created a new project using the latest version of Android Studio (0.2.2), this is a fresh install of studio. When I am in the project explorer view, it fails to show me any folders for my project. I should see a root project folder, and within it the .idea, gradle, and module folders, but they are not showing.
Here is what I expect to see (taken from the sample project created on first boot):
But here is what I see immediately after the project's creation:
I cannot figure out how to expose my project's folders! I do not want to develop without the project explorer, it's simply too much of a hassle. Did I create the project incorrectly, or am I missing some not-so-obvious setting somewhere?
Thanks.
The problem here is that I assumed android studio would create a module for the application. I assumed this because it asked me at the beginning for app name, module name, package, sdk info etc.
This assumption turned out to be false. You must create your first module manually through File > Project Structure. After that is done, the project explorer shows the files.
File -> Project Structure -> Modules
Add Button (Green plus button) click -> New Module Select
New Module window -> "Content root" change path button click to select "Project root file path"
Apply to change save and "OK" button exit.
In the project Explorer there is a drop down menu where you have selected project, now change it to project files.
I hope this will solve your problem. reply if it didn't.
You have created a new gradle project not a new android project.
Update your android studio tools to 0.2.3 - Go to Help menu - select check for update.
then Update your android sdk tools, android support repository, android support library and android build tools using android sdk manager.
And update some configuration in project structure. Go to File menu->project structure -> in projects tab select Android SDK as default sdk and in SDKs tab set correct path to updated android sdk.
Now restart android studio and try to create a new project and it should work fine.
(Noted for posterity) I had a similar issue come up recently, when importing an Eclipse android project. The issue was that the source folder wasn't added as such. I had to manually go into Project Structure -> Modules -> Sources and make sure that the "src" folder wasn't excluded and was marked a source folder.
Although this question is asked years ago. But now following simple solution worked for me.
Clicking 'Sync Project With Gradle files' makes all directories visible.
I had this exact same issue, there are some problem if you upgrade from 0.1.9 version to 0.2.0 in Windows.
Android Studio 0.2.0 Release
The solution (which worked for me) was to completely uninstall Android Studio and reinstall the 0.2.0 version.
I had the same problem today. Additionally, the IDE posted an "Assertion Error" into its event log.
Downloading and reinstalling the preview version, then applying the patch to 0.2.6 worked for me.
Change the SDK to a level that you have installed in the SDK manager. The SDK manager can be accessed from Tools -> Android -> SDK Manager. For me, Android Studio was packaged with API Level 17 but the new project wizard tried to target API Level 18.

Categories

Resources