How to Import an Existing Project from Github into Android Studio

Import from github to android studio

Step 1: Download Zip. Don't Fork the project or use git command or VCS in android studio.

Step 2: Open Android Studio->New Project->Open->Select android directory.

Step 3: Android Studio tells you this is a eclipse project (Convert it to gradle blah blah). Hit Next. This is the time I came to know this is an eclipse project and why android studio is not detecting it.

Step 4: Done.

PS: Thanks to comments(Comment Author has deleted his comment).

How to re-import an existing project from github into Android Studio? I don't want to keep local changes

Git is simply saying that a directory with the name of the project you want to clone and import already exists. It's not asking for confirmation, it is simply refusing to clone it to the location of your choice. You have at least two options to deal with this:

  • Delete (or alternatively rename) the existing directory so that Git can clone the repo anew
  • Reset the repository so that it matches the remote, discarding your changes:

    git fetch origin
    git reset --hard origin/master

Link to a detailed answer by Dan Moulding.

How to connect existing Android Studio project to existing Github repository

I would view this thread if you want to create a new project.

How do you synchronise projects to GitHub with Android Studio?

If this doesn't help then I would just delete your current(local) project and import from github.

http://teamtreehouse.com/library/android-tools/git/pulling-down-github-projects-to-android-studio

I would recommend staying with command line. It is great practice. View link below for more information.

https://softwareengineering.stackexchange.com/questions/173297/why-learn-git-when-there-are-gui-apps-for-github

Import Android Studio project from git into Android Studio (Gradle)

The answer is obvious when looking at the .gitignore file of a newly created project. The build.gradle file is and should be included in the push to the remote repo.

So the person who made the repo in my question is doing it wrong. The .gitignore file includes:

.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures

As seen, more files should of been uploaded to the remote repo.



Related Topics



Leave a reply



Submit