If you are using multiple flavors?
-make sure the resource file is not declared/added both in only one of the flavors and in main.
Example: a_layout_file.xml
file containing the symbol variable(s)
src:
flavor1/res/layout/(no file)
flavor2/res/layout/a_layout_file.xml
main/res/layout/a_layout_file.xml
This setup will give the error: cannot find symbol variable, this is because the resource file can only be in both flavors or only in the main.