Android: R.java: error <identifier> expected

僤鯓⒐⒋嵵緔 提交于 2019-12-01 04:51:44

It sounds like you have accidentally defined a menu item in your XML with an id of =action_setting.

For example:

<menu>
    <item 
        android:id="@+id/=action_settings" />
</menu>

Remove the = from your menu XML and you should be good to go.

I had the same problem, because I defined a string without name in my resources. like:

<string name="">some text</string>

check your resource file name should be following file naming rule. Example:

Invalid file name: 50x60.png Valid file name: my_pic.png

I had similar problem. Step 1. Delete/edit files which caused error, in your case: "public static final int =action_settings=0x7f050018;"

Step 2. Build->Clear. Since R.java cant be modified and automatically generated, dont edit anything in R.java. Good luck! :)

I encountered the same error message. In my case it seemed to be caused by the inclusion of '.int' in the package name.

Replacing '.int' in the package name:

com.xxxx.int.yyyy

With '.intg' resolved the error for me:

com.xxxx.intg.yyyy
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!