Missing R.java file even though project cleaned

后端 未结 12 1690
猫巷女王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:42

    You should definitely check your XML files as most people here post. This is because this problem is most likely because of something in your resources not being right, possibly due to debugging. HOWEVER, if this is not the case you may want to check for folders with any resources that have any CAPITAL LETTERS. also you want to make sure you are using the roman alphabet to name resources properly. This made me scratch my head a little bit because a lot of my folders and settings are in Chinese. I saved some projects to a workspace in a folder in Dropbox named 麥思樂的安卓計劃. I changed the name of the folder and problem solved.

提交回复
热议问题