0

I am implementing a git project into my android project. When i added the git's project java classes they turned red.

I found this question. But the answers don't work for me. Android Studio - All file names in project are red but there are no errors

I thought the answer would be, because of VCS control, and i need to delete the .idea folder. But i have looked everywhere in my project and their is no .idea folder.

DJ.
  • 6,664
  • 1
  • 33
  • 48

1 Answers1

0

Sounds like you are adding new files to a Git project. In this case, AndroidStudio will turn those files red because they haven't been staged or committed yet.

Try navigating to your project and typing git status. You should see those same files as unstaged.

To resolve this, simply stage those files to git (you can use git add -a to add them all at once) and they should turn green. Alternately, you can right click on those red files -> Git -> Add.

Finally, after you've committed the files, they should turn blue.

Ben Chen
  • 71
  • 1
  • 3
  • i am not trying to push to a git repo. I downloaded some files off a git repo. When i added those files into my projects folder, the files turned red in android studio. – user5560712 Nov 20 '15 at 00:48
  • `git add` doesn't push anything to the git repo. Only `git push` will push to the repo. Because you downloaded your project from a git repo, any new files that weren't part of the git repo will be in red. By adding or committing those new files, they will turn green or blue. – Ben Chen Dec 15 '15 at 20:18