如何在 Android 中修复“索引 37 处的非法字符 <:>:com.xride.app-mergeDebugResources-115:/values/values.xml”

How to fix "Illegal char <:> at index 37: com.xride.app-mergeDebugResources-115:/values/values.xml" in Android

提问人:M.Jamous 提问时间:8/12/2023 更新时间:8/12/2023 访问量:22

问:

这是 ATTR 文件

  <declare-styleable name="WeekdaysPicker">
    <attr name="enabled" format="boolean" />
    <attr name="highlight_color" format="color" />

    <attr name="text_unselected_color" format="color" />
    <attr name="sunday_first_day" format="boolean" />
    <attr name="show_weekend" format="boolean" />
    <attr name="week_end_darker" format="boolean" />
    <attr name="weekend_color" format="color" />
    <attr name="weekend_text_color" format="color" />
    <attr name="full_size" format="boolean" />
    <attr name="recurrence" format="boolean" />
    <attr name="border_color" format="color" />
    <attr name="border_thickness" format="integer" />
    <attr name="border_highlight_color" format="color" />
    <attr name="border_highlight_thickness" format="integer" />
</declare-styleable>

<attr name="text_color" format="color" />
<attr name="button_text_color" format="reference" />
<attr name="button_background_color" format="reference" />
<attr name="button_disabled_background_color" format="reference" />
<attr name="background_color" format="reference" />
<attr name="input_layout_background_color" format="reference" />
<attr name="icon_color" format="reference" />

项目中没有任何内容包含 <:>,并且尝试使缓存无效并重新启动不起作用,尝试更改 attr 值名称也不起作用。

Java Android 错误处理

评论

0赞 aled 8/12/2023
这似乎不是完整的文件。有效的 XML 文件应具有根元素。
0赞 M.Jamous 8/13/2023
是的,根就是这样“<资源>”

答: 暂无答案