報錯原因:
sdk 下的 /platform-tools/api/annotations.zip 這個文件裏的 xml 文件不規範造成的。
解決辦法:
- 到 sdk 目錄下找到 /platform-tools/api/annotations.zip 這個文件並解壓
- 用文本編輯器(推薦 Notepad++ )打開以下的所有文件
並且把標籤內的 “<” 和 “>” 字符分別替換成 "<” 和 “>”
- 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文件
覺得改着太累的話,我這裏有改好的 annotations.zip