I think these posts are the best here on stackoverflow that are related to my issue:
“R cannot be resolved to a variable”?
R cannot be resolved - Android error
I tried every answer on those posts, but I still didnt fix my "R cannot be resolved to a variable" error. I'm really desperate at this point. The interesting part is that I had yesterday the same problem and I fixed it with the clean project + restart IDE method, but today it's not working. I never had this problem until I updated my ADT to ADT 21.1.0. I know that my res files are not allowed to have any errors, but they have some warnings. Are those warnings coausing the problem?