I just started working with Android apps and was trying few sample programs. I noticed an issue with the main开发者_开发问答.xml file. It happened twice today, I added few new layout views in main.xml (Using Layout and XML both), as soon as I made a modification and tried running the program, the R.java class would throw an error, also a new file called main.out.xml is getting created automatically. On top of this, when I am trying to "clean" the project, it deletes the R.java file altogether. Why is it acting this way?
This is a bug in the eclipse IDE relating to android development. I had the same problem when I first started. You need to make sure that the file that is currently being edited (i.e. active in the editor) is a java source file when you try to run the project. If any other file is active, such as your main.xml file then it ends up creating this main.out.xml that is a garbage file. To fix, just delete the garbage main.out.xml and make sure a java file is active and hit run and you are back to normal.
Try deleting that tmp file and re-cleaning the project
精彩评论