本文针对APK回编译过程中遇到的常见错误进行了详细的解析,并提供了具体的解决方案。例如,当出现Public symbol drawable declared here is not defined错误时,通常是因为资源文件或图片被删除但未从public.xml中移除导致;对于Error retrieving parent for item: No resource found that matches the given name错误,则可能是因为样式文件中的父级样式引用不存在。
error: Public symbol drawable declared here is not defined.多数情况下我们修改完后使用“apktool b xxx”命令并不能保证可以顺利地回编译。
常见的错误是.../res/values/public.xml:数字 error: Public symbol.../xxxx declared here is not defined
这跳debug信息告诉我们/res/values/public.xml文件中第“数字”行出错,里面指定的对象在res目录下不存在。
这是精简或图片资源引用错误引起的,比如某张图片在其他dpi里定义了,在当前保留的dpi里却用不到,当我们把它删除
后,并没有删除它在public.xml文件中的定义,程序回编译的时候按照public.xml去找它却已经找不到了,于是就报错了。
解决的方法就是打开public.xml文件,删除相应的行
error: Error retrieving parent foritem: No resource found that matches thegivenname '@android:style/WindowTitle'.
error: Error retrieving parent foritem: No resource found that matches thegivenname '@android:style/WindowTitleBackgroun
加*号
<style name="Base.TextAppearance.AppCompat.Widget.Button.Inverse" parent="@*android:style/WindowTitle" />
<style name="Base.Widget.AppCompat.Button.Colored" parent="@*android:style/WindowTitleBackground" />