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.
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.
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.
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?
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.
Try file -> invalidate caches / restart -> Invalidate caches and restart
Try deleting .gradle and .idea folder of project. For me its solved the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With