I would like to fix this error
R cannot be resolved to a variable
I looked up many answers, but I could not get the right one;
I had the same problem. I fix it by deleting the file in 'gen' directory, then I clean the project then the R.java was automatically generated.