今天研究aapt打包资源,在aapt源码里加了些log,但aapt一直打包失败,
错误的打包命令:
aapt p -f -S ./res -M ./AndroidManifest.xml -I /home/lishicheng/source/project/out/target/product/project/system/framework/framework-res.apk -F ./DeskClock.apk
错误提示:
No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'
原因Theme.AppCompat.Light.NoActionBar是v7兼容包的资源,需要把v7兼容包下的res添加进路径,一起参与打包。
正确的命令:
aapt p -f -S ./res -S /home/lishicheng/source/project/frameworks/support/v7/appcompat/res -S /home/lishicheng/source/project/frameworks/support/v7/gridlayout/res -S /home/lishicheng/source/project/frameworks/opt/datetimepicker/res -M ./AndroidManifest.xml --extra-packages android.support.v7.appcompat:android.support.v7.gridlayout:com.android.datetimepicker --auto-add-overlay -F ./DeskClock.apk -I /home/lishicheng/source/project/out/target/product/project/system/framework/framework-res.apk
来源:CSDN
作者:L_Scag
链接:https://blog.csdn.net/L_Scag/article/details/104009538