.xml: Invalid file name: must contain only [a-z0-9_.]

在Android开发中,遇到布局加载错误时,若提示文件名中包含大写字母,可能是由于XML文件名不符合规范。正确做法是确保文件名全部使用小写字母和下划线,避免大写或特殊字符,以确保布局资源正常加载。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

出现这种提示可以检查android 中layout的.xml文件名中是否有大写 Android的Layout文件的文件名中是不可以包含大写字母的,例如List.xml中因为L大写就会有这种提示
genius@genius-virtual-machine:~/dayang_ws$ colcon build [0.158s] WARNING:colcon.colcon_core.package_identification:Failed to parse ROS package manifest in &#39;src/dayang_robot_description&#39;: Error(s) in package &#39;src/dayang_robot_description/package.xml&#39;: The manifest must contain exactly one "description" tag Starting >>> dayang_robot_description --- stderr: dayang_robot_description Error parsing &#39;/home/genius/dayang_ws/src/dayang_robot_description/package.xml&#39;: Traceback (most recent call last): File "/opt/ros/humble/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py", line 150, in <module> main() File "/opt/ros/humble/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py", line 53, in main raise e File "/opt/ros/humble/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py", line 49, in main package = parse_package_string( File "/usr/lib/python3/dist-packages/catkin_pkg/package.py", line 639, in parse_package_string pkg.description = _get_node_value(_get_node(root, &#39;description&#39;, filename), allow_xml=True, apply_str=False) File "/usr/lib/python3/dist-packages/catkin_pkg/package.py", line 800, in _get_node raise InvalidPackage(&#39;The manifest must contain exactly one "%s" tag&#39; % tagname, filename) catkin_pkg.package.InvalidPackage: Error(s) in package &#39;/home/genius/dayang_ws/src/dayang_robot_description/package.xml&#39;: The manifest must contain exactly one "description" tag CMake Error at /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:95 (message): execute_process(/usr/bin/python3 /opt/ros/humble/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py /home/genius/dayang_ws/src/dayang_robot_description/package.xml /home/genius/dayang_ws/build/dayang_robot_description/ament_cmake_core/package.cmake) returned error code 1 Call Stack (most recent call first): /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:49 (_ament_package_xml) /opt/ros/humbl
03-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值