报错原因:
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