'R cannot be resolved to a variable' - gen folder is empty

前端 未结 14 2393
故里飘歌
故里飘歌 2021-02-13 22:34

I\'ve got an error:

R cannot be resolved to a variable

in line:

setContentView(R.layout.main);

but I can\'t r

14条回答
  •  暖寄归人
    2021-02-13 22:56

    On eclipse you have the "Problems" window. If you fix all the other problems in there other than R cannot be resolved, the "R" problem will be auto-fixed as R is not generated because most likely you have project related problems.

    Hope this helps. If you don't manage to do it, put a print of what your Problems window is showing.

提交回复
热议问题