[Android] Android Build 时报错: java.io.IOException: Could not parse XML from android/accounts/annotati...

Android构建时报错:

app:lintVitalRelease[Fatal Error] :3:214: 与元素类型 “item” 相关联的 “name” 属性值不能包含 ‘<’ 字符。

Could not read /Users/panxin/Library/Android/sdk/platform-tools/api/annotations.zip

java.io.IOException: Could not parse XML from android/accounts/annotations.xml

原因:sdk下/platform-tools/api/annotations.zip这个文件里的xml文件不规范造成的。

解决方法:

    到sdk目录下找到/platform-tools/api/annotations.zip这个文件并解压。

    用记事本打开以下两个文件,并且把标签内的 ‘<’ 和 ‘>’ 字符分别替换成 "&lt;” 和 “&gt;”。

    android/accounts/annotations.xml
    android/hardware/camera2/annotations.xml
    android/hardware/camera2/params/annotations.xml
    android/app/slice/annotations.xml
    android/widget/annotations.xml
    android/view/annotations.xml
    android/view/textclassifier/annotations.xml
    android/bluetooth/le/annotations.xml
    android/media/annotations.xml
    android/preference/annotations.xml
    android/text/annotations.xml

    保存并压缩,替换掉原来的annotations.zip文件。

本博客地址: wukong1688

本文原文地址:https://www.cnblogs.com/wukong1688/p/10773419.html

转载请著名出处!谢谢~~

转载于:https://www.cnblogs.com/wukong1688/p/10773419.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值