R.java strange error

I cannot figure out which kind of error is this. We all saw a lot of strange stuff, regarding android and R.java, but I am seeing this for the first time.

In the R.java, i have the following line of code:

 public static final class id {
    public static final int 15dp=0x7f060067;

The error says - Syntax error on token "15d". delete this token.

At first I thought that I made some typo and wrote "15d" instead of "15dp" somewhere, but I didn't. I checked the entire layout xml file, that I was making the last, since after making it this error started appearing.

I tried deleting R.java and building the app, didn't helped.

Does anybody has a clue what this might be ?


You probably have in some layout file something like this:


change this to a vaild id and try it again.

i know this question is already answered,but some more knowledge about this error:

R.java maintains all the references of id's of views,strings.xml tag names,Drawables etc, if you are facing this kind of issue,then it is necessarily the error of miss spell in some id naming,sting tag names or drawable name's something like this:


dp is the unit for density independent pixel,so we can not assign this as id to any view neither as drawable name nor string tag name.

hope this helps.

Need Your Help