Basit
Basit

Reputation: 8606

getting error Error:res/menu/mainMenu.xml:invalid file name:must contain only[a-z0-9_.]

I am new to android and just started it. I created a file in res folder, menu/mainMenu.xml. But i got the error

Error: res/menu/mainMenu.xml: invalid file name: must contain only[a-z0-9_.]

When i changed the file name to just mainmenu(remove the capital M) then it started working. Why? I am using intelliJ 10.5.1.

Thanks

Upvotes: 0

Views: 1387

Answers (2)

Samir Mangroliya
Samir Mangroliya

Reputation: 40416

it should be mainmenu.xml ,no capital letter is allowed in naming of xml files.

  File name must contain only lowercase a-z, 0-9, or _.
  • only a-z,mind that not capital...and white-space not allowed

  • name must start with a character.not with a Number(0-9)

  • name only _ symbol allowed.no other symbol alowed.

Upvotes: 1

user1391869
user1391869

Reputation:

xml file doesnot support capital letter in naming of xml file so try removing capital letter.

correct mainmenu.xml or main_menu.xml. For further detail you can look onto this.

Upvotes: 2

Related Questions