tags:

views:

57

answers:

4

Again and again I have the case that during development, the Android SDK suddenly doesn't regenerate the "R" file. Usually this is due to some error in one of the many .xml files, but that darn thing doesn't give the slighted indication, as to WHY it suddenly refuses to regenerate that file.

There is no error or warning listed for any of my .xml files and manually checking all those (meanwhile almost hundred!) XML files for errors is no real fun, either!

Is there some option or log or something that would allow to locate the problem quicker and more direct? Last time I had to do a lengthy binary search (i.e. copying and removing files to/from a second test project) trying to locate the offending file. That's really a nightmare and not how it should be in any decent SDK that deserves that name!

Michael

+2  A: 

One option that works well and isn't related to the actual SDK: use source control and commit often. When it's broken, diff against the previous revision. Let a tool made for this do the investigative work.

JRL
Good hint! I guess, after all I will have to create a local repository on my home PC just for that very purpose...
mmo
+1  A: 

sometimes this could happen if "invalid" file found under res folder or its subfolders. do you see any error message in console window?

Asahi
Yep - the console window brought me further. One of the string-ids was misspelled! ADK really could be a bit more user friendly and put a marker there instead of just throwing all hooves into the air and fall over!
mmo
A: 

It is important that your manifest file and ALL xml files are valid!

Sometimes the R Class is generated after "Clearing and rebuilding" the project in eclipse.

joki
Well - I definitely noted THAT requirement! That's why I complained...
mmo
A: 

Check the timestamp of the files?

Lie Ryan