Question

There is exactly 100 errors in R.java that all say the same error. The error is the following:

Syntax error on token "10", delete this token

There are red flags everywhere saying not to modify R.java and even when I try to, it prompts me to stop. Then when I still change something it reverts back to the errored code. The lines that causing errors are below.

    public static final int 10ca16=0x7f05084a;
    public static final int 10ca17=0x7f05084b;
    public static final int 10ca18=0x7f05084c;
    public static final int 10ca19=0x7f05084d;
    public static final int 10ca2=0x7f05083c;
    public static final int 10ca20=0x7f05084e;
    public static final int 10ca21=0x7f05084f;
    public static final int 10ca22=0x7f050850;
    public static final int 10ca23=0x7f050851;
    public static final int 10ca24=0x7f050852;
    public static final int 10ca25=0x7f050853;
    public static final int 10ca26=0x7f050854;
    public static final int 10ca27=0x7f050855;
    public static final int 10ca28=0x7f050856;
    public static final int 10ca29=0x7f050857;
    public static final int 10ca3=0x7f05083d;
    public static final int 10ca30=0x7f050858;

I just got down inputting 100s and 100s of strings into strings.xml since I am trying to localize and support Spanish. I'm sure it probably has something to do with that.

My question is what exactly is wrong? My two strings.xml files in my values and values-es folders do not have any errors flagged.

Was it helpful?

Solution

There are red flags everywhere saying not to modify R.java and even when I try to, it prompts me to stop.

Maybe something was trying to tell you that you shouldn't touch the file.

But that being said:

public static final int 10ca16=0x7f05084a;
//                      ^^^^^^

Variable names in Java cannot start with a number. This is a restriction that's been on C-derived languages since they were invented.

Start the variable name with an underscore or letter, like _10ca16 or ca10_16 (or whatever you prefer).

OTHER TIPS

Variable names can't start with a number. If you change the strings to start with a letter instead, it will work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top