2013-07-26 65 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被描述。

相关问题