错误:解析 XML 时出错:格式不正确(令牌无效)...? [英] error: Error parsing XML: not well-formed (invalid token) ...?
本文介绍了错误:解析 XML 时出错:格式不正确(令牌无效)...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用以下 XML 处理应用程序.但是当我尝试清理/构建我的项目时,会发生以下错误:
I am working on an application, with following XML. but whenI try to clean/build my project the following error occurs:
错误:解析 XML 时出错:格式不正确(令牌无效)"
"error: Error parsing XML: not well-formed (invalid token)"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello";
/>
</LinearLayout>
这可能意味着什么?
推荐答案
这意味着您的 XML 文件中存在编译错误,该错误不应该存在:拼写错误/虚假字符/不正确的命名空间.
It means there is a compilation error in your XML file, something that shouldn't be there: a spelling mistake/a spurious character/an incorrect namespace.
你的问题是你有一个不应该在这一行之后出现的分号:
Your issue is you've got a semicolon that shouldn't be there after this line:
android:text="@string/hello";
这篇关于错误:解析 XML 时出错:格式不正确(令牌无效)...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文