R cannot be resolved to a variable

后端 未结 29 1173
不知归路
不知归路 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 15:15

    This error is because of deleting R.java file from project /gen folder. If you have backup of your project, please go to the project directory and paste R.java file which you copy from your backup section.

    Corrupt R.java file can also be caused by an error in XML. Often these kinds of errors don't show up in eclipse, so I'd suggest taking a look at your XML files. After that you can also try to Clean your project by going to Project -> Clean... in the menu bar.

提交回复
热议问题