Error with sharing Android Studio project with GitHub - android

So when I try to share my project with GitHub through Android Studio, it says I have done it successfully, and a new repository is created, but when I open the repository, it is empty. I'm pretty inexperienced with GitHub, and I have spent hours trying different things and I can't get it to work, so if someone could help point me in the right direction, I would be extremely appreciative.

Here are the steps for seamlessly working with Android Studio and github
Create a new project in Android Studio.
Create some files.
Go to VCS -> Enable Version Control Integration. Select git
Go to VCS -> Commit File and select all the files that you want to commit with a message.
Go to VCS -> Push.
Click on Define Remote.
Enter the url for the already created repository in github.
Click Push and enter the Github password.
P.S : I am using Android Studio version 1.5 If you are using some other version, then the steps can be a little different.

After creating Repository, you have to push/commit the source files to the server. It seems you have not committed any file yet.
You can use some other Git clients like Source Tree with GitHub

Related

unable to run a cloned repo in android studio

I cloned a Beacon Library https://github.com/Codefy/onebeacon-android from github, it has some samples that i want to run, but as i cloned the repo my debug buttons become disabled.
The README file says that sample projects are ready to build, it would be really helpful if someone would explain how to run it.
i repeat that i want to run base service module on my deivce.
Thanks in advance.
Solution
It turned out that the right way to do was to :
(1) Open Android Studio, then File-> New -> import project -> select sample directory.
(2)Then fix the gradle issues.
(3) Select the specific module you want to run.
Create a new folder and open it using the terminal. Clone the GitHub repo using the terminal (git clone https://github.com/xxxxxxxxxx/xxxx.git). Then open it using the Android studio and you will be able to run it. I don't know how, but it worked for me.
Just Restart Your android Studio. It works for me.

Importing Android Studio Project into GitHub

I have a project made in Android Studio that I wish to put into a GitHub repository. I used "Import into version control" -> "Share project on GitHub". Android Studio then made an empty repository on my GitHub account with the name that I specified. I simply cannot make an initial commit now that the repository is there. When I use VCS -> Git -> Commit file, it simply pops up a window that says "Nothing to commit.". I've tried making a new dummy file, and yet it still thinks there have been no changes. I've also tried selecting all of the files and using the "add" button, but this appears to do nothing whatsoever. How can I get this project on GitHub? My desire, specifically, is literally just to somehow commit my project in Android Studio into this GitHub repository it has created for me so that I can collaborate on this project with some friends. Thanks in advance.
If there is nothing to commit, Android Studio has already commited all your files locally. Now you need to VCS > Git > Push to upload your commits to your GitHub repository.
What ended up happening is I just created a new project, copied and pasted all of my code in, and then used the "Share Project on GitHub" button again. This time, for whatever reason, it worked seamlessly.

Bitbucket plugin can't connect in Android Studio

I recently downloaded the Bitbucket plugin for Android Studio (I'm running 1.1.0). Initially, I downloaded it from this link (https://plugins.jetbrains.com/plugin/6207?pr=phpStorm) which should be compatible with Android studio.
When I tried to clone a project in my repo, it prompted me for login credentials. I entered them, but it tells me that I can't connect to bitbucket. Then I installed the plugin from the plugin settings page seen here
I made sure that the plugin was enabled. I'm thinking this is an issue that has to do with proxy settings (I'm currently on my college campuses network, but I can connect to other VCS services like Git without problems so I doubt that's the problem).
Any suggestions?
EDIT:
Going into Bitbucket's settings and testing it shows this:
Had the same problem some time ago. Though I have not yet upgraded to 1.1, I found this implementation to work with previous version:
https://bitbucket.org/dmitry_cherkas/jetbrains-bitbucket-connector/downloads
It seems the "official" one is outdated and this one is working fine.
Please, let me know if this does work for you.
Regards
Jose
you don't really need bitbucket plugin.
Push your project to bitbucket
create a new repo in bitbucket
click on "I have an existing project" in bitbucket repo
execute these commands in Android studio Terminal to push your project to bitbucket
Checkout from Bitbucket
you can also checkout bitbucket projects giving bitbucket URL in "Checkout from GitHub" option in Android Studio
If you are still having problems (like I was recently) even though you've tried the plugin and you feel uncomfortable or not knowledgeable about initializing git for your project by hand via terminal you can use SourceTree. You will have no problems with BitBucket using source tree since both are made by Atlassian.
Once you've installed SourceTree and walked through the first boot setup process giving SourceTree your credentials you click Clone/New and a dialog will pop up. There will be the normal browse button and also a button button that looks like a globe allowing you to browse the hosted projects linked to your BitBucket account. You can also copy an paste the link from the project home on bitbucket as well. Once you've chosen the repo you want to clone, pick the destination folder and if you want to bookmark the project or not and press "clone".
Once clowning is complete you should hit the pull button to pull down the latest changes picking the appropriate branch you want to pull from. When pulling is complete you should have all the files that's on the head of that branch (master if not specified) which in most cases is an android project.
Open Android Studio and choose File->Open and browse to the folder you just pulled data to and that open the android project. Once that is done and the project is open make sure you go to VCS and you should not see "Enable Version Control Integration". If you see this that means android studio does not see the .git folder hidden in the project root (or something in that ball park....maybe it's really not in the project root). If you see git commit and git pull options then you are now using version control and bitbucket as your remote repo. Make a change to a file and you should see it turn blue specifying that changes have been made but not committed.
For more info on version control in android studio see this video https://youtu.be/Ldmc757EXaE?t=6m47s and the documentation on the intellij website.

Bitbucket - Push project files to an empty Git repository

I have created a Git Repository on bitbucket. The repository is empty now. I have an Eclipse project, in my system, that I want to push(using Eclipse - EGit) into the repository I created. How do I do it?
I have no knowledge of doing this by command line, so, please, give me the details for doing this by using the GUI of Eclipse. Any links that might help, also are appreciated.
First, make sure you already installed EGit or other git control plugins on your Eclipse.
Second, add Git Source Control to your existing Android Eclipse Project (local) and create a local Git Repository for the Project, by following the steps below: (or check this video)
right click your project -> Team -> share project
check the option of "Use or create repository in parent folder of project"
select your project
click the button of "create repository"
hit "finish"
right click your project -> Team -> Add to Index
right click your project -> Team -> commit
Then push your Project (now is under local Git Source Control) to a Remote Repository such as GitHub.com or BitBucket.org, by following the steps below: (or check this video)
right click your project -> Team -> remote -> push
type in the URL of the remote repository you are using
type in username and password, then hit "next"
click the button of "Add All Branches Spec"
click "next"
click "finish"
Okie.. So I figured it out.
Steps :
First, create a new workspace.
Open that workspace in eclipse.
Go to New->Other->Git->Git Repository
Browse to the Workspace, you just created. Follow the steps in dialog and finish it.
Copy, your existing code, (src, res, etc.,) into the project folder.
Import the project into workspace, File->Import->General->Existing projects into workspace.
Once the application builds, you will have NO HEAD beside the project.
Right click on the project folder, Go to Team->Commit
Enter Commit Message and do Commit And Push. This will take you to screen that asks for URI in bitbucket.
Copy the clone path from bitbucket and paste in the URI path and complete the steps in the dialog. (If you get to a screen asking for Add Specs headers or similar, select the master for Add/Update header and click on button that says Add all specs and finish it.)
Thats it.
Note ::: I am not yet that comfortable with Git, so, probably, the steps may or may not be the correct way or the easiest way to do it. But, that said, these steps worked for me. They might work for you too.
Hope this helps..
Create a git project in eclipse by cloning it from a repository link.
Then open a project location on your drive. Usually C:/Users/yourname/projectname. If you don't know where it is, it says under a working tree in eclipse.
Copy your files/folders there and refresh the project in eclipse.

I deleted my git project from Eclipse, how can I open it again and sync?

I just used Eclipse and Egit in order to make my first open source project.
This was working pretty well and I made some commits and push during a few weeks.
Now, I have my Android project in my git folder (localy) with some unpushed commits.
Due to some bad manipulations, I removed my project from Eclipse, and I would like to import ir again and push the commits I made.
First thing I tried was to "import" an existing project and pointed the folder of my application, that worked but I lost all my "team" tab and cannot push again.
all the git informations are not linked. (no commits, no push,...)
I also tried to start a new project and choose "from existing source" but with the same result.
Thank a lot for any help.
I will answer myself.
I had to right click on the project, select team, then share.
At this place I had to fill with Github repository, was not so intuitive, but I did it.

Categories

Resources