R cannot be resolved to a variable

后端 未结 29 1206
不知归路
不知归路 2020-11-28 14:14

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;

29条回答
  •  鱼传尺愫
    2020-11-28 14:50

    If R is missing

    • Locate your R.java file, it should be in the folder ./gen/
    • If it is missing, and "build project" doesnt build it, one of your XML files has errors, fix them or even delete them, then right-click your project and click build project
    • R.java file should be generated

提交回复
热议问题