Vivek Kalkur
Vivek Kalkur

Reputation: 2186

R.java file disappears all of a sudden

While building my android project,at the initial stage R.java file which is automatically generated was present.But gradually when I went on building my application,it suddenly disappeared.What might be the reason for this?

Upvotes: 1

Views: 915

Answers (3)

duta
duta

Reputation: 13

it have a error in xml file that you build.

The source code that is in your xml file is incomplete.

Have you try to check your xml?

Upvotes: 0

Michael
Michael

Reputation: 54705

It can happen because of errors in resources. Usually the reason is malformed nine-patch image, but the actual problem is displayed in the Error Log view.

EDIT: According to your comment the problem is that injectron.xml file contains whitespace in its name. Just remove it and R.java will be regenerated again.

Upvotes: 2

romy_ngo
romy_ngo

Reputation: 1061

It might be deleted when Eclipse (suppose that you are using Eclipse IDE) rebuilds project and couldn't be regenerated automatically. I think that may be the reason. Change something in layout, string or id in res folder to see if R.java is regenerated again. If it does then you are fine.

Upvotes: 3

Related Questions