Amyth
Amyth

Reputation: 32949

Android: Menu.xml error : No Resource matches the given name

i am trying to make a simple menu for my android application. But don't know why i am getting the following error in my menu.xml file:

[2012-07-21 11:53:27 - Torchit] W/ResourceType( 5469): Bad XML block: header size 46936 or total size 163847776 is larger than data size 0
[2012-07-21 11:53:27 - Torchit] /home/tigerstyle/workspace/Torchit/res/menu/menu.xml:2: error: Error: No resource found that matches the given name (at 'id' with value '@id/menu_item_about').

The menu.xml code is as follows:

<menu xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:id="@id/menu_item_about"
      android:title="About"
      android:icon="@drawable/menu_about" />
</menu>

Upvotes: 0

Views: 889

Answers (1)

Srikanth
Srikanth

Reputation: 306

You need to add a "+" after the "@" like this

<menu xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:id="@+id/menu_item_about"
      android:title="About"
      android:icon="@drawable/menu_about" />
</menu>

Without that, it looks for a resource which has already been defined with that id.

Upvotes: 6

Related Questions