2012-05-26 121 views
3

我正在創建一個android應用程序,當更改一些代碼並運行它時,我被告知應用程序的R.Java文件中有錯誤。我不知道這個錯誤來自哪裏,我似乎無法修改它。R.java錯誤。不知道從哪裏來。不知道如何修復它

的R.Java裏面的代碼是

public final class R { 
    public static final class array { 
    public static final int races_array=0x7f040000; 
} 
public static final class attr { 
} 
public static final class drawable { 
    public static final int icon=0x7f020000; 
    public static final int logo=0x7f020001; 
} 
public static final class id { 
    public static final int 1=0x7f060007;//this line has the error 
    public static final int BMI=0x7f06001f; 
    public static final int Cdate=0x7f060005; 
    public static final int Current=0x7f060006; 
    public static final int Days=0x7f06001e; 
    public static final int activity=0x7f06001b; 
    public static final int advice=0x7f060004; 
    public static final int cals=0x7f060022; 
    public static final int cheight=0x7f060013; 
    public static final int choice=0x7f060019; 
    public static final int code=0x7f06001d; 
    public static final int cweight=0x7f06000a; 
    public static final int date=0x7f060020; 
    public static final int dateDisplay=0x7f060008; 
    public static final int details=0x7f06001c; 
    public static final int eheight=0x7f060011; 
    public static final int eweight=0x7f060012; 
    public static final int get=0x7f06000d; 
    public static final int goal=0x7f060025; 
    public static final int group=0x7f060023; 
    public static final int newheight=0x7f060017; 
    public static final int newweight=0x7f060016; 
    public static final int nweight=0x7f06000c; 
    public static final int out=0x7f06000e; 
    public static final int out_text=0x7f060002; 
    public static final int pass=0x7f060018; 
    public static final int pickDate=0x7f060009; 
    public static final int progress=0x7f06001a; 
    public static final int start=0x7f060003; 
    public static final int step=0x7f060001; 
    public static final int steps=0x7f060021; 
    public static final int t1=0x7f06000f; 
    public static final int t2=0x7f060010; 
    public static final int textView1=0x7f06000b; 
    public static final int textView2=0x7f060024; 
    public static final int textView3=0x7f060014; 
    public static final int textView4=0x7f060015; 
    public static final int tv=0x7f060000; 
} 
public static final class layout { 
    public static final int activity=0x7f030000; 
    public static final int advice=0x7f030001; 
    public static final int choice=0x7f030002; 
    public static final int convert=0x7f030003; 
    public static final int main=0x7f030004; 
    public static final int notes_row=0x7f030005; 
    public static final int progress=0x7f030006; 
    public static final int splash=0x7f030007; 
} 
    public static final class string { 
     public static final int app_name=0x7f050001; 
     public static final int hello=0x7f050000; 
     public static final int race_elf=0x7f050003; 
     public static final int race_goblin=0x7f050007; 
     public static final int race_halfling=0x7f050006; 
     public static final int race_human=0x7f050005; 
     public static final int race_orc=0x7f050002; 
     public static final int race_troll=0x7f050004; 
    } 
} 

我不知道如果這能幫助任何人,但我只是想知道是什麼創造了這個錯誤,我怎麼能解決這個問題。

回答

9

你有一個id定義爲@+id/11不會生成有效的Java標識符,因此是錯誤。出於同樣的原因,不能創建名稱以數字開頭或包含空格或匹配保留關鍵字的id或資源。

+0

謝謝。我確切知道那是什麼。我會盡我所能接受你的答案 –