aapt 命令提示No resource found that matches the given name

Today, research aapt packaged resources, in aapt source added some log, but failed aapt been packaged,

Wrong packaging commands:

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 

Error message:

No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'

The reason is Theme.AppCompat.Light.NoActionBar v7 compatible package of resources, need to add res under v7 compatibility pack into the path involved with the packaging.

The correct order:

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

Released seven original articles · won praise 10 · views 3575

Guess you like

Origin blog.csdn.net/L_Scag/article/details/104009538