The Mysterious Android Studio Red R
Published Summer, 2017
So your awesome code won’t compile and the only errors you can see are red R’s on all of your resources. And yet, you can see nothing wrong with your code. What’s worse is that Android Studio isn’t flagging any resource files as defective. So it strongly suggests that the problem is in your code – maybe you missed a semi-colon somewhere and it’s cascading down, right? But no, that isn’t the problem.
The problem really is with a file in your resources folder. Unfortunately, it can be difficult to find since the system is showing the error to be in the java code. As you can see in the example below, the error is actually a misspelling of the word “item” in the styles resource file. And yet, if the file wasn’t opened and the red error box visible, you’d be forgiven for assuming the problem was with the java code.