R.java file just went missing

妖精的绣舞 提交于 2019-12-13 04:23:57

问题


I'm working on my app and for this activity I was going to build a new layout file for it. However eclipse gave me an error stating that layout was not updated in the R.java file. So I read online that modifying manifest would update the R.java file but it didn't. So I clicked on clean project and my R.java file disappeared propagating errors across all my src files. Now I heard that it could be due to layouts named with capital letters but all my layouts start with small letters. Also even if I manually add a R.java file and click on clean, the R.java disappears after. I really don't know what to do now. I also tried most of the solutions from the similar questions but to no avail.


回答1:


Any error on XML files will prevent R generation. Check for mark errors and Eclipse console (some errors when parsing XML are shown there).

Also I've seen Eclipse generates some dumb files with .out.xml or .xml.out extensions. I'm not sure why it happens, but any "allien" file on res folder also prevents R to be regenerated.




回答2:


Thanks for your help guys. I tried to look at every file to check for errors but after 30 minutes of scratching my head, I just opened a new project and copied each file to the new project and that is working now.



来源:https://stackoverflow.com/questions/17712580/r-java-file-just-went-missing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!