Missing R.java file even though project cleaned

后端 未结 12 1689
猫巷女王i
猫巷女王i 2020-12-03 07:41

Every time in code that I have an R, I get an error R cannot be resolved to a variable.

The R.java file appears to be missing.

I have tried cleaning the proj

12条回答
  •  鱼传尺愫
    2020-12-03 08:38

    That happens when the project cannot be build, because the project name may not be sufficient for building.

    You need to create another project without any unacceptable symbols and copy all code files (.java, xml files, etc) and paste it to newly created project. Then clear your project (project -> clean) and select the build automatically option.

提交回复
热议问题