当前位置:网站首页>与元素类型 “item” 相关联的 “name” 属性值不能包含'<” 字符解决办法
与元素类型 “item” 相关联的 “name” 属性值不能包含'<” 字符解决办法
2022-07-28 11:40:00 【yi_tianchou】
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文件不规范造成的。
annotations.xml 这个文件报错,那么就打开这个文件看一下。
annotations.zip 解压之后得到android,根据报错信息找到报错的文件。
发现:
<item name="android.accounts.AccountManager android.accounts.AccountManagerFuture<android.os.Bundle> addAccount(java.lang.String, java.lang.String, java.lang.String[], android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler)">
比如修改后的一段:
<item name="android.accounts.AccountManager android.accounts.AccountManagerFuture<android.os.Bundle> addAccount(java.lang.String, java.lang.String, java.lang.String[], android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler)">
<annotation name="androidx.annotation.RequiresPermission">
看到了吧 ,<> 里面带有 <>. 这个在xml里是不允许的。
自己修改:1、用记事本打开报错的文件(看报错信息android/accounts/annotations.xml),并且把标签内的 ‘<’ 和 ‘>’ 字符分别替换成 "<” 和 “>”
2、修改完之后,保证 <>,里没有<>后保存,替换annotations.zip里报错的文件,回到项目再次编译。
边栏推荐
- GMT installation and use
- 设计一个线程池
- SQL injection less23 (filter comment)
- HMS core audio editing service supports 7 kinds of audio effects to help one-stop audio processing
- 云原生机器学习落地难?灵雀云助力企业快速应用 MLOps
- Developing NES games with C language (cc65) 02. What is v-blank?
- Aopmai biological has passed the registration: the half year revenue is 147million, and Guoshou Chengda and Dachen are shareholders
- 聚变云原生,赋能新里程 | 2022 开放原子全球开源峰会云原生分论坛圆满召开
- Exploration on cache design optimization of community like business
- To build agile teams, these methods are indispensable
猜你喜欢

OpenAtom OpenHarmony分论坛圆满举办,生态与产业发展迈向新征程

GMT installation and use

Knowledge points of MySQL (13)

Localization, low latency, green and low carbon: Alibaba cloud officially launched Fuzhou data center

Open source huizhichuang future | 2022 open atom global open source summit openatom openeuler sub forum was successfully held

Not optimistic about Apple making AR, Luo Yonghao: I'll do it myself

用C语言开发NES游戏(CC65)10、游戏循环

Brief discussion on open source OS distribution

Introduction to resttemplate

Minimally invasive electrophysiology has passed the registration: a listed enterprise with annual revenue of 190million minimally invasive mass production
随机推荐
PHP date calculation operation processing, the current date plus one day and the specified date minus one day
Tik tok "founder" Yang Luyu, farewell byte?
How to realize more multimedia functions through the ffmpeg library and NaPi mechanism integrated in openharmony system?
Solve the PHP prompt warning: division by zero in error
Developing NES games with C language (cc65) 02. What is v-blank?
Developing NES games with C language (cc65) 08. Background collision
Foam exploded three times, why did Luo Yonghao put all his eggs in one basket to do ar?
SuperMap arsurvey license module division
Did kafaka lose the message
Four authentic postures after suffering and trauma, Zizek
新东方单季营收5.24亿美元同比降56.8% 学习中心减少925间
1331. Array sequence number conversion: simple simulation question
Industry, University, research and application jointly build an open source talent ecosystem | the 2022 open atom global open source summit education sub forum was successfully held
Tencent two sides: @bean and @component are used in the same class, what will happen?
Most of the interfaces of Tiktok are already available, and more interfaces are still open. Please look forward to it
Is it difficult for cloud native machine learning to land? Lingqueyun helps enterprises quickly apply mlops
数字经济时代的开源数据库创新 | 2022 开放原子全球开源峰会数据库分论坛圆满召开
The usage and Simulation Implementation of vector in STL
SuperMap itablet license module division
Open source huizhichuang future | 2022 open atom global open source summit openatom openeuler sub forum was successfully held