2013-07-26 133 views
0

這是一次又一次產生的錯誤。 我已經清理了我的項目。令牌「int」上的語法錯誤,此令牌R.java錯誤後預期爲VariableDeclarationId

public static final class id { 
     public static final int =0x7f07005b; 
     public static final int button1=0x7f070004; 
     public static final int button2=0x7f070005; 
     public static final int frameLayout1hardMatchup=0x7f070009; 

在String.xml中沒有錯誤,這裏是我的String.xml。

<string name="hello">Hello World, MemoryCardsActivity!</string> 
<string name="app_name">Princess Memory Cards</string> 
<string name="text_name">Congrates</string> 
<string name="text_help">Turn over pairs of matching cards, tap to flip two cards, as the match happens, they get removed from the screen.Try to get all cards match in minimum moves and proceed to next level</string> 

而且也沒有任何@ + ID類型的錯誤。 還有什麼可能是這個原因。 任何積極的反應將非常感激.. :(

回答

2

你缺少一個變量名

public static final int = 0x7f07005b; 

代替

public static final int variableName = 0x7f07005b; 
+1

不錯的捕獲+1 :) – Blackbelt

+0

@blackbelt謝謝,我不喜歡沒有詳細解釋的答案,但...;) – codeMagic

+1

這是清楚的名字,但我已經檢查了我所有的類和xml文件,我在那裏沒有發現任何錯誤。有沒有什麼辦法可以檢測出我會錯過的地方,如果我是小姐。 :( –

1

我改變我的佈局XML文件中的一個產生了類似的錯誤我改變了

android:id="@+id/image_frame" 

android:id="@+id/ " 

我這種變化中看到的錯誤是

public static final int =0x7f080010; 
// Syntax error on token "int", VariableDeclaratorId expected after this token 

這似乎是什麼@codeMagic被描述。

相關問題