出现“entry index is larger than available symbols” <index ,total symbols> 的研究
来源:互联网 发布:37热血战歌羽化数据 编辑:程序博客网 时间:2024/05/17 05:00
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://yiyangde7.blog.51cto.com/392692/1076436
C:\apk\s\res\values\public.xml:240: error: Public entry identifier 0x7f03014e entry index is larger than available symbols (index 334, total symbols 315).
C:\apk\s\res\values\public.xml:240: error: Public symbol drawable/notification_header_bg declared here is not defined.
出现这样的错误提示告诉我们public.xml中的第240行,id为0x7f030144e的行出现了问题。
那到底出了什么问题呢?什么是”entry index is larger than available symbols”?334和315到底是什么意思?“not defined”没有定义是怎么回事?
这都是我当初会问的问题,而且问了不止N遍。
我们来看下public.xml中的240行到底写了什么 240 <public type="drawable" name="notification_header_bg" id="0x7f03014e" />
有什么问题呢?貌似没有什么问题。这不是写的清楚明白的么?让我们结合上下文来看。
用Notepad++打开public.xml,
在这个”drawable”类中起始行是173,id为0x7f03000a。结束行是487,id为0x7f030126 。 行数487-173=314,这不就是”total symbols 315“的含义么,315即为总行数。
同样在这个”drawable”类中起始id是0x7f030000(第193行) ,结束id为0x7f030153(第245行),为什么不是上面的0x7f030126(第487行)?因为行数虽然是按顺序排列,但id可不是,最大的id有可能在行的中间,所以很多教程说的在最后添加id可不是跟着最后一行的id,而是同类中的最大id后添加。
“drawable起始id在193行”
{240行id”0x7f03014e“} - {起始id”0x7f030000“} = 14e,十六进制14e换算为十进制为334,看到了没这就是334的含义。
就是说240行id定义的是334号,结果总行数为315,超出了总行数的限制,于是报错。这是因为id不连续造成的。
打个比方,大家去银行取钱要拿号排队,如果总人数为315人,结果号拿到了334,意味着什么?中间有人拿了号没取钱就走了呗。银行可以,程序不行,它只会按顺序读取,少一个就出错。告诉你“not defined”。
public.xml就像个记账本,所有大事小事都记在上边。按类型分好后,再按id排序。如果反编译的时候出现新的项(如图片),public.xml会自动加入id,但这时已不能保证后续兼容性。
- APKTOOL编译出现“entry index is larger than available symbols” (index ,total symbols) 的研究
- 出现“entry index is larger than available symbols” <index ,total symbols> 的研究
- Kafka错误“Network is unreachable”和“larger than available brokers”
- could not read symbols: Archive has no index;
- Bad XML block: header size 2370 or total size 0 is larger than data size 0
- Bad XML block :header size 2370 or total size 0 is larger than data size 0
- bitmap index 的研究
- bitmap index 的研究
- bitmap index 的研究
- libtest.a: could not read symbols: Archive has no index; run ranlib to add one的原因和解决方案
- 使用Vue的时候出现 $index is not defined
- 自建Yii项目进入shell 出现Error: index.php does not exist or is not an entry script file.
- W/ResourceType( 1356): Bad XML block: header size 144 or total size 0 is larger than data size 0
- W/ResourceType( 4896): Bad XML block: header size 215 or total size 0 is larger than data size 0
- Python的Symbols
- field-symbols 的用法
- Field-Symbols的使用
- windbg的symbols配置
- 最大子矩阵和
- Java 文件读写
- 音频编码
- 用 C 语言编写 Windows 服务程序的五个步骤
- Hello TWaver Android
- 出现“entry index is larger than available symbols” <index ,total symbols> 的研究
- 使用Storm实现实时大数据分析
- 爸妈争吵小孩被吓出抽动症
- 计算年龄
- weblogic中文乱码问题总结
- combo+treePanel
- FLV视频封装格式详解
- spring2.0-2.5-3.0变化
- IOS塔防游戏《坦克对大炮》的开发设计记录