Java 错误:分析XML时出错:未绑定前缀

Java 错误:分析XML时出错:未绑定前缀,java,android,xml,bluetooth,Java,Android,Xml,Bluetooth,我在strings.xml文件中遇到了这个错误:error:error解析xml:unbound前缀 <resources> <string name="mainTitle">Remote Doctor </string> <string name="app_name">Remote Doctor</string> <string name="patientButton">Patient Mode &

我在strings.xml文件中遇到了这个错误:error:error解析xml:unbound前缀

<resources>
    <string name="mainTitle">Remote Doctor </string>
    <string name="app_name">Remote Doctor</string>
    <string name="patientButton">Patient Mode </string>
    <string name="doctorButton">Doctor Mode </string>
    <string name="aboutButton">About </string>
    <string name="exit">Exit</string>
    <string name="simpleMode">Simple Mode</string>
    <string name="detailedMode">Detailed Mode</string>
    <string name="aboutTitle">About Remote Doc</string>
    <string name="aboutText">\
    Remote Doc is an application that allows a brace user and the doctor to analyze and record  
    how often the brace is being worn and how much force or pressure the brace is putting on 
    the user       </string> 

    <!--  BluetoothChat -->    
    <string name="send">Send</string>    
    <string name="not_connected">You are not connected to a device</string>    
Error:  <string name="bt_not_enabled_leaving">Bluetooth was not enabled. Leaving Bluetooth Chat.</string>    
    <string name="title_connecting">connecting...</string>    
    <string name="title_connected_to">connected to <xliff:g id="device_name">%1$s</xliff:g></string>    
    <string name="title_not_connected">not connected</string>    
    <!--  DeviceListActivity -->    
    <string name="scanning">scanning for devices...</string>    
    <string name="select_device">select a device to connect</string>    
    <string name="none_paired">No devices have been paired</string>    
    <string name="none_found">No devices found</string>    
    <string name="title_paired_devices">Paired Devices</string>    
    <string name="title_other_devices">Other Available Devices</string>    
    <string name="button_scan">Scan for devices</string>    
    <!-- Options Menu -->    
    <string name="secure_connect">Connect a device - Secure</string>    
    <string name="insecure_connect">Connect a device - Insecure</string>    
    <string name="discoverable">Make discoverable</string>   
</resources>


远程医生
远程医生
患者模式
医生模式
关于
出口
简单模式
详细模式
关于远程文档
\
远程文档是一个应用程序,允许支架用户和医生分析和记录
支架的磨损频率以及支架施加的力或压力
用户
邮寄
您未连接到设备
错误:蓝牙未启用。离开蓝牙聊天室。
连接。。。
已连接到%1$s
不相连
正在扫描设备。。。
选择要连接的设备
没有设备配对
找不到任何设备
配对设备
其他可用设备
扫描设备
连接设备-安全
连接设备-不安全
使可发现

我做错了什么?

BluetoothChat下的第三个选项旁边写着“Error:”。这就是导致错误的原因,还是您添加了它以显示导致错误的行?

BluetoothChat下的第三行旁边写着“error:”。这就是导致错误的原因,还是添加了它以显示导致错误的行?

您没有为
%1$s
定义XML命名空间

事实上,您需要绕过
xliff:g
标记来避开
标记中的文本将作为原始XML处理,而不是作为字符串值的一部分

将此选项用于标题\u connected\u to条目:


连接到xliff:g id=“设备名称”%1$s/xliff:g
您没有为
%1$s
定义XML命名空间

事实上,您需要绕过
xliff:g
标记来避开
标记中的文本将作为原始XML处理,而不是作为字符串值的一部分

将此选项用于标题\u connected\u to条目:


连接到xliff:g id=“设备名称”%1$s/xliff:g

您需要
在资源标记之前

您需要
在资源标记之前
您使用了错误的
开头标记。将
更改为
您对
使用了错误的开头标记。将
更改为
是的,不确定是什么,但答案是肯定的。检查这篇SO帖子:是的,不确定是什么,但答案是肯定的。检查这篇SO帖子:我在问题中包括了它。我在问题中包括了它。设备名称是在一个单独的xml文件中定义的。设备名称。xml:好的,但您没有在资源文件中定义名称空间。我不熟悉您试图引用设备名称的方式,但从XML解析器的角度来看,这就是您提供的XML无效的原因。设备名称是在一个单独的XML文件中定义的设备名称。XML:OK,但您没有在资源文件中定义名称空间。我不熟悉您试图引用设备名称的方式,但从XML解析器的角度来看,这就是您提供的XML无效的原因。