时间: 2020-09-19|tag:6次围观|0 条评论

项目\res\drawable\btn_grey.xml:4: error: Error parsing XML: not well-formed (invalid token)

今天运行程序的时候无意中出现这个异常,发现自己也没弄什么就报这个错了,然后按报错位置找到了当前的xml,看了发现自己没改过这里,然后将xml中的

第一个item的

android:drawable="@drawable/button_grey" 

android:state_enabled="true"  android:state_window_focused="false"用空格隔开,然后build一下就好了。



报错的xml:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">


    <item android:drawable="@drawable/button_grey" android:state_enabled="true"  android:state_window_focused="false"/>
    <item android:drawable="@drawable/button_grey_press" android:state_pressed="true"/>
    <item android:drawable="@drawable/button_grey" android:state_enabled="true"/>

</selector>

原文链接:https://blog.csdn.net/llixiangjian/article/details/74064930

本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。

本博客所有文章如无特别注明均为原创。
复制或转载请以超链接形式注明转自起风了,原文地址《error: Error parsing XML: not well-formed (invalid token)
   

还没有人抢沙发呢~