简体   繁体   English

出现错误错误:res / menu / mainMenu.xml:无效的文件名:必须仅包含[a-z0-9_。]

[英]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. 我是android的新手,刚刚开始。 I created a file in res folder, menu/mainMenu.xml. 我在res文件夹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. 当我将文件名更改为mainmenu(删除大写字母M)后,它开始工作。 Why? 为什么? I am using intelliJ 10.5.1. 我正在使用intelliJ 10.5.1。

Thanks 谢谢

xml file doesnot support capital letter in naming of xml file so try removing capital letter. xml文件在命名xml文件时不支持大写字母,因此请尝试删除大写字母。

correct mainmenu.xml or main_menu.xml . 正确的mainmenu.xmlmain_menu.xml For further detail you can look onto this . 有关更多详细信息,请查看此内容

it should be mainmenu.xml ,no capital letter is allowed in naming of xml files. 它应该是mainmenu.xml ,在命名xml文件时不允许使用大写字母。

  File name must contain only lowercase a-z, 0-9, or _.
  • only az ,mind that not capital...and white-space not allowed az ,请注意不要大写...并且white-space not allowed

  • name must start with a character.not with a Number(0-9) 名称必须以字符开头,不能以数字(0-9)开头

  • name only _ symbol allowed.no other symbol alowed. 只能命名_符号,不允许其他符号。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 res \ layout \ Contact_us.xml:文件名无效:必须仅包含[a-z0-9_。] - res\layout\Contact_us.xml: Invalid file name: must contain only [a-z0-9_.] 无效的文件名:必须仅包含[a-z0-9_。] - Invalid file name: must contain only [a-z0-9_.] "“无效的文件名:必须仅包含 [a-z0-9_.]”,用于 Android Studio 中的声音文件" - “INVALID FILE NAME: MUST CONTAIN ONLY [a-z0-9_.]“ for sound files in Android Studio java android:res \\ drawable-hdpi \\ Restaurant-Blue-2-icon.png:无效的文件名:必须仅包含[a-z0-9_。],无法修复 - java android: res\drawable-hdpi\Restaurant-Blue-2-icon.png: Invalid file name: must contain only [a-z0-9_.], cant fix 为什么android xml文件名必须只包含小写字母和数字([a-z0-9_。])? - Why android xml file name must contains only lowercase letters and digits ([a-z0-9_.])? Android:在res中使用SVG会导致错误:“文件名必须以.xml或.png结尾” - Android: Using SVG in res leads to error: “The file name must end with .xml or .png” ! 错误。 文件名必须以 xml 结尾 - ! Error. The file name must end with xml 错误:文件名必须以 .xml 或 .png 结尾 - Error: The file name must end with .xml or .png 收到此错误“模块'base'和'moduleA'包含具有不同内容的条目'res/drawable/xyz.xml'。” - Getting this error “Modules 'base' and 'moduleA' contain entry 'res/drawable/xyz.xml' with different content.” 使用Android O的“android:fontFamily”时出现错误“文件名必须以.xml结尾”? - Getting error “file name must end with .xml” while using the “android:fontFamily” of Android O?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM