Android Studio - All file names in project are red but there are no errors

Android StudioGradleIntellij Idea

Android Studio Problem Overview


I imported a ADT Project in Android Studio. I got a ton of errors, but I could fix them all. I don't think the "how" is important in this case, I wouldn't be able to recall all the errors anyways. The project runs now without errors, but somehow Android Studio marks all files red. Just the filenames, there are no errors in the code. I tried cleaning and restarting.

enter image description here

Did someone experience something like this before? Or maybe a related problem with IntelliJ someone could solve?

Edit:
It was the version control. The project was unversioned but in a SVN controlled folder. Thats what the red was indicating. A solution could be to copy the project to a different folder or to add the files to version control.

Android Studio Solutions


Solution 1 - Android Studio

Perhaps you are seeing the File Status colors that Android Studio uses to show the status of the file. Open Settings and go to Editor > Colors & Fonts > File Status. Here you can see what all of the different colors mean. My guess is that your reddish files are that color because you have not yet added them to source control.

Solution 2 - Android Studio

I had the same problem: everything was in red and my MainActivity was not found. I resolved it doing:

File -> Invalidate Caches / Restart

Solution 3 - Android Studio

If anyone happens to import a project and then all files and folder names are brown, that means files/folders are unknown. This happens if imported project has VCS control, to solve this you just have to check in your project root folder for .idea folder and inside it if there's an XML file called vcs.xml: if so, just rename it or delete it, then close and reopen project, all names will become black.

Solution 4 - Android Studio

It can be because of you version control system. May be you haven't committed your change on the files committing your change will restore the file names' color to white or go to File->Settings->Version Control and disable the VCS

Solution 5 - Android Studio

Just simply right clicked the file -> GIT -> Add.

Solution 6 - Android Studio

It is because Version Control(like Git) have been enable in your project.

Go to File -> Settings -> Editor. Under Version Control select File Status Colors. It contains list of different colors and what they mean.

enter image description here

Solution 7 - Android Studio

From the screenshot that you have attached, it appears that it is because of VCS enabled.

Case 1: You want to use VCS. And you have not committed the code. If this is the case, then please commit the code.

Case 2: VCS is enabled and you are not aware of that. To disable this, Go to Setting-> Version Control.

In the right panel, you will see a Project and type of VCS. Select that row and click on the VCS item. In the dropdown, select .

This will resolve your issue.

Solution 8 - Android Studio

Using SVN repository under Android Studio, I got same issue after renaming the package name. To solve it, you will need to do a right click on the red files/Subversion/Add to CVS -> Then the files will be green, after you have to commit them, they will be normal (black color).

Solution 9 - Android Studio

This happened to me every time I would set up a git repo in my project. To answer the question, simply add the problematic files to your VCS, "git add" in my case and you should be good to go.

Solution 10 - Android Studio

Solutions for existing project that are newly cloned

  • delete or rename .idea/vcs.xml and restart android studio
  • Check exact folder is added as root in File->Settings->Version Control
  • Check proper vcs tool configured in File->Settings->Version Control and remove unwanted entries

Solution 11 - Android Studio

VCS: commit After that, the red color is gone in my case.

Solution 12 - Android Studio

I've had similar problems with IntelliJ and have some more details that may prove helpful:

  • If for some reason IntelliJ imports a project using a VCS other than what is used by your project, it may effect how it looks at project roots. For example, IntelliJ kept importing projects with Subversion as the VCS when we use Git -- Subversion creates a root for every top-level folder and Git just had just a single root (I have no idea why).
  • As suggested above, going into Settings->Version Control (IntelliJ IDEA ->Preferences for OS X) and changing the VCS type to "Git" or "none" would make the red characters go away.
  • I had no idea why IntelliJ kept importing the project as Subversion so I went into the plugins and disabled "Subversion Integration" -- that got rid of the problem for good.

Solution 13 - Android Studio

I had similar issue, i had git version control installed and it happened after i changed my package name.

I had resolved the same by "git add .".

Hope it helps others.

Solution 14 - Android Studio

I went to my project folder (c:\users\ ... \AndroidStudioProjects\my project folder\ , and deleted the .git folder. (it's hidden).

The Problem Solved.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiontritopView Question on Stackoverflow
Solution 1 - Android StudioScott WView Answer on Stackoverflow
Solution 2 - Android StudioNeteroView Answer on Stackoverflow
Solution 3 - Android StudioalexscmarView Answer on Stackoverflow
Solution 4 - Android StudioTekaView Answer on Stackoverflow
Solution 5 - Android StudioLunoxView Answer on Stackoverflow
Solution 6 - Android StudioSiva PrakashView Answer on Stackoverflow
Solution 7 - Android StudioBhargav JhaveriView Answer on Stackoverflow
Solution 8 - Android Studiouser2167877View Answer on Stackoverflow
Solution 9 - Android StudioGabe ClarkView Answer on Stackoverflow
Solution 10 - Android StudioNidhinView Answer on Stackoverflow
Solution 11 - Android StudioHoman HuangView Answer on Stackoverflow
Solution 12 - Android Studiouser1266599View Answer on Stackoverflow
Solution 13 - Android StudioShivinView Answer on Stackoverflow
Solution 14 - Android StudioHamid MontazeriView Answer on Stackoverflow