Does changing an Android Studio project to another folder cause problems? - android

I was working on an Android app, and decided to do an initial git commit. The project folder was on my desktop so I moved it into a newly created folder as to not make the Desktop into a git repository. The project was open in Android Studio when I moved it and made the commit, and when I went back to it it didn't work.
I closed it and reopened it and it wouldn't compile (I was a fool and didn't screen shot the error message) but then it started to work.
However, all the files in the project are in red, not the code itself, just the files that a visible in the tab on the left and the tabs at the tops of the open files. The project works but I want to get rid of the red as obviously it's an indication that something's not right.
I have to send this project for review tomorrow and I hope this won't create an issue for the recipient.
Thanks

The files are red because they have not been committed to git.
git add . and git commit -m "your commit message" should fix it.
And No it should not be a problem. I suggest you read more about git, it's a cool tool

Related

Android Studio changing code automatically

Something very weird is happening.
I am on the master branch of my repository. After calling git pull I get the latest version of the code on the master branch, everything is ok.
But for some reason, Android Studio, after some seconds, changes the code, so that now, even if I do git pull I get Already up-to-date but if I call git status I see changes not staged in red. How is that possible?
Also, if I click cmd+z I can see for few seconds how the code added by Android Studio goes away, and immediately comes back.
I tried deleting the entire project and cloning again from the repository, and again I get the latest version of the fresh code, but after few seconds Android Studio changes it.
All that happens in a particular file and section of code.
When you make git pull it doesn't reset or throw the changes you have non staged, you have to commit them the only reason you would see a problem with these files were is there was a conflict and git would notify you and tell you you need to commit before the pull.
so if you want to commit these change you need to do:
git add .
git commit
or if you want to throw away these changes you need to do:
git reset --hard HEAD
that last command would let you with the exact same code as in the remote repository.
That's happening because each time you opening a project with Android Studio, it will check for Android Studio project configuration files. When Android Studio did not find any of these files, it will create them. The configuration files will be in the .idea folder. Therefore, you will see a red mark for those unstaged files.

Android Studio showing unchanged files in commit changes dialog box

I am using Android Studio 2.0 Beta 6 on Ubuntu GNOME. I am facing a strange problem. I am using git version control in my Android project. After building the project, when I click on commit changes through Android Studio GUI. The commit changes dialog box shows every file as changed. When I click on any file, it says contents are identical. I am attaching the screenshot below, clicking on any files says contents are identical.
So my question is, Why Android Studio shows files with identical changes in commit changes dialog and how can I solve it? I tried google but didn't found any related question.
It must be because of automatic file encoding changes by the IDE (In case you imported the project from somewhere else). Sometimes IDEs apply them automatically. Just revert the changes and do a clean and build. If the changes appear again, you will need to do a commit once and after that you'll be allright.
To verify you can just go to a normally behaving file. Open it in notepad and just save as from notepad with another encoding. It should show as modified thereafter in the version control window.
For me it was AS pointing to old git version. Please check the Settings\Version Control\Git
I ran into this issue as well. None of the typical culprits seemed to be at fault. As far as git (from the command line) was concerned, the files were unmodified, yet Android Studio still showed them as modified.
It turns out Android Studio and my command line terminal (cygwin) were using two completely different Git binaries. Android Studio was pointing to a Git installation I had made at some point in the past, while cygwin was pointing to /usr/bin/git, which had come from Cygwin's Git package.
I edited Android Studio's version control settings (as shown in Anton's screenshot) to point to the git.exe within my Cygwin distribution, then did a "refresh file status" from the VCS menu, and all the files went back to showing as unmodified.

Importing GitHub project to AndroidStudio not appearing correctly

I'm working on an Android application and I've pushed it to GitHub from my windows computer, I'm having problems to pull the code from repository in Mac OS, when it downloads it shows like if the project was corrupt or something.
It shows this:
As you can see the project doesn't download the folder app and all the files that i pushed to the Repository
I might not be pushing it correctly because i've tried to clone well built Android repositories and and they work nicely.
Thanks a lot for your help and Sorry for my English.
Things which you need to do, crate a directory where you want the project to be set up this.
I made a directory called Juanjors_AndroidMeneame and navigated my git bash there.
as shown in the image initialize local git repository.
and then pull the data. as shown in the image
git pull https://github.com/Juanjors/AndroidMeneame.git
after this import the project, and this is what you will get

git eclipse pulls no project

I am new to working with repositories.
I'm forced to work with my team on academic project using git. My job is to write Android app.
The problem is when I wrote it, then pushed it to repo I want to pull it on different machine.
But when I pull it, I get only "source" files, no: (for example) R.java.
Moreover: I wanted to use "Clean project" Option, but it seems, that my Eclipse is not treating the pulled files as project (when I click "Clean..." I can choose any project in my workspace, but the download one is lacking).
Anyone could help me?
EDIT:
I've solved the problem:
Git doesn't push to repository automatic-generated files, like R.java. After you pull it back, you have to Clear project and rebuilt it. If it still doesn't work: try restarting 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