[Android] Android Build 時報錯: java.io.IOException: Could not parse XML from android/accounts/annotations.xml


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

轉載請著名出處!謝謝~~


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM