Hi folks, 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?
@PSU_Kardi, Thank you so very much :)
t3ch
2010-10-12 02:41:18
What exactly causes this problem?
t3ch
2010-10-12 02:41:48
Well it did remove the error notification, but now as soon as I try to run the program, its creating the same main.out.xml and then program fails saying Error parsing XML: no element found
t3ch
2010-10-12 02:59:31
+3
A:
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.
metalideath
2010-10-12 03:08:02
@metalideath, Thanks. Perfect solution. Worked liked a charm. There is no permanent fix for this? Are there any other traps I need to watch out for?
t3ch
2010-10-12 03:17:58
Thats the only really goofy thing that I have noticed. I have been unable to find a solution other then this work around.
metalideath
2010-10-12 03:36:41