Android Studio - all file names in the project are red, but there are no errors

I imported the ADT project into Android Studio. I have many mistakes, but I can fix them all. I do not think that β€œhow” is important in this case; I would still not be able to recall all the mistakes. The project works without errors, but somehow Android Studio marks all the files in red. Just file names, there are no errors in the code. I tried to clean and restart.

enter image description here

Has anyone experienced this before? Or maybe someone could solve the problem with IntelliJ?

Edit:
It was version control. The project was unversioned, but in a folder managed by SVN. That indicated by red. The solution may be to copy the project to another folder or add files to version control.

+60
android intellij-idea android-studio gradle
Aug 11 '14 at 14:45
source share
12 answers

Perhaps you see the file status colors that Android Studio uses to display the file status. Open Settings and go to Editor> Colors and Fonts> File Status. Here you can see what all the different colors mean. I assume that your reddish files have this color because you have not added them to the source code yet.

+111
Aug 11 '14 at 2:52
source share

I had the same problem: everything was red, but MainActivity not found. I resolve this by doing:

File -> Invalid Cache / Reboot

Et voilΓ  !!

Good luck.

+21
May 28 '15 at 15:10
source share

If someone wants to import a project, and then all the file and folder names are brown, then the files / folders are unknown. This happens if the imported project has VCS control, for this you just need to check the project root folder for the .idea folder and inside it, if there is an XML file called vcs.xml: if so, just rename it or delete it, then close and open the project again, all names turn black.

+12
Dec 14 '14 at 12:11
source share

This may be due to your version control system. You may not have made your changes to the files fixing your changes in order to restore the color of the file names to white or go to File-> Settings-> Version Control and disable VCS

+10
Jun 25 '15 at 9:43
source share

From the screenshot you connected, it looks like this is due to the included VCS.

Case 1: You want to use VCS. And you did not commit the code. If so, please commit the code.

Case 2: VCS is turned on, and you do not know about it. To disable this, go to Settings β†’ Version Control.

In the right pane, you will see the project and type of VCS. Select this line and click the VCS item. From the drop-down list, select.

This will solve your problem.

+5
May 28 '15 at 15:20
source share

Using the SVN repository in Android Studio, I got the same problem after renaming the package name. To solve this problem, you need to right-click on the red files / Subversion / Add to CVS β†’ Then the files will be green, after you complete them, they will be normal (black).

+2
Aug 31 '16 at 3:45
source share

This is because version control (e.g. Git) has been enabled in your project.

Go to File β†’ Settings β†’ Editor . Under " Version Control select" File Status Colors Contains a list of different colors and their meanings.

enter image description here

+2
Aug 11 '18 at 11:46
source share

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

+1
Jul 05 '17 at 16:36
source share

I had similar problems with IntelliJ, and you have more detailed information that you might find useful:

  • If for some reason IntelliJ imports a project using VCS other than what your project uses, this may affect how it looks at the roots of the project. For example, IntelliJ continued to import projects with Subversion as VCS when we use Git - Subversion creates a root for each top-level folder, and Git just has only one root (I don’t know why).
  • As mentioned above, going to Settings-> Version Control (IntelliJ IDEA β†’ Settings for OS X) and changing the VCS type to "Git" or "none" will make the red characters go away.
  • I had no idea why IntelliJ continued to import the project as Subversion, so I went into the plugins and disabled "Subversion Integration" - this got rid of the problem forever.
0
Jun 02 '17 at 1:06 on
source share

Solutions for an existing project that have been recently cloned

  • delete or rename .idea / vcs.xml and restart android studio
  • Make sure the exact folder is added as root in File-> Settings-> Version Control
  • Check the correct vcs tool configured in File-> Settings-> Version Control and delete unnecessary entries
0
Oct 18 '18 at 4:19
source share

I went to my project folder (c:\users\... \AndroidStudioProjects\my project folder\ and deleted the .git folder. (It is hidden).

The problem is resolved.

0
Oct 29 '18 at 16:59
source share

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

0
Apr 6 '19 at 17:26
source share



All Articles