Siavash
Siavash

Reputation: 7853

Cannot build R file but I have NO errors in my res folder

I already tried: clean, restart eclipse, create and delete a dummy xml file. if there are no errors in my res folder, what else can cause R file to not get generated. enter image description here

Upvotes: 0

Views: 768

Answers (2)

ENSATE
ENSATE

Reputation: 325

I often faced this issue,and what i have experienced,is that you might have named some files wrongly like (begining name with numerics characters,using some allocated words like new,integer,class...)

I hope this could help you.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007266

There can also be issues in AndroidManifest.xml. Sometimes, the Eclipse Package Manager tree will not show red X marks for files that actually have errors (though it has gotten better about that). So, I'd suggest opening up AndroidManifest.xml, and other resources that you have recently edited, to confirm that there are no errors there.

Also, bear in mind that R.java is not created until you do a build. Normally, we have Build Automatically checked in Eclipse, so a build happens on each save. If you unchecked that, either re-check it or manually do a build.

You might also check the Eclipse Console tab to see if there are red error messages there.

Finally, you can try a command-line build. It used to be that I would find errors there that, for whatever reason, Eclipse was not showing me. I have not needed to do that in well over a year, but it's possible there are still some scenarios where it might be useful.

Upvotes: 3

Related Questions