Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the source code 'all red' in Android Studio

I'm always using Android Studio's debugger to walk through the code and see how things work.

As I dive deeper into the SDK, I get to lisView.java for example, and now it's class members are mostly red? (see link)

Why is that?? I could see my code and parts of the SDK prior to 'stepping in' listView.java? Why suddenly is it all red on the right-had column?

As you see in the screenshot, now I can't see the value for the member variable, mOldItemCount for example. screen shot of listView.java

like image 814
Drawn Avatar asked Jan 15 '17 20:01

Drawn


People also ask

Why is my project Red in Android Studio?

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. Show activity on this post. Perhaps you are seeing the File Status colors that Android Studio uses to show the status of the file.

How to fix r is red error in Android?

To remove R is red error, select make Project from Build and waits for gradle to finish. Then open android monitor (at the bottom the screen). Here you will find the actual error causing R is red error. Remove that error and again click on make Project from Build.

What does the R symbol mean in Android Studio?

The letter R stands for the Resource. This error occurs because of the incapability of the build process to Sync Resource files with your projects. Usually, this happens because of the improper build of the project. Why There is a Need to fix “cannot resolve symbol R” in Android Studio?

Why is my R file not being generated in Android?

Because sometimes, the R file is not generated because of package name in AndroidManifest does not match with the package module that you have. You might need to check XML Files specifically if you have followed the correct syntax for ids. Then clean the project.


2 Answers

Try file -> invalidate caches / restart -> Invalidate caches and restart

like image 182
Hayk Mkrtchyan Avatar answered Oct 21 '22 03:10

Hayk Mkrtchyan


Try deleting .gradle and .idea folder of project. For me its solved the problem.

like image 31
Vladyslav Panchenko Avatar answered Oct 21 '22 03:10

Vladyslav Panchenko