I'm building an Android app targeting Android API 33 (Android 13). When I build the app on the command line using gradlew, I see the following warning:
aapt2 W 09-02 02:57:09 6715 6715 LoadedArsc.cpp:682] Unknown chunk type '200'.
What on earth does this mean, and should I expect side effects?
Let's take a look at the
LoadedAsrc.cppfile mentioned, used in relation to resources.arsc. Your warning mentions line 682, and if we look a few lines before that, we can see your warning on line 677.This warning seems to happen if whilst looking through the "overlayable policy chunks", we find a
overlayable_child_chunk.type()that does not equalRES_TABLE_OVERLAYABLE_POLICY_TYPE.By looking at the
switchandcasestatements, we can see that child chunks of aRES_TABLE_TYPE_SPEC_TYPEchunk should be of typeRES_TABLE_OVERLAYABLE_POLICY_TYPE, defined in this older copy of the code as0x0205(517?), not the200shown in your error. When a child chunk is the incorrect type, we go todefault, throwing the warning seen.This warning is being called inside
LoadedPackage::Load, where we are trying to populatetype_builder_mapusingloaded_package(see line 748). So, now we know that we're seeing this warning because a child chunk type is set incorrectly whilst trying to do... something around building up a map of types. This is summarised as:At this point, there's not much value in diving deeper in my opinion. The main takeaway is:
This warning is generated deep inside the compiler, and doesn't matter so long as everything works. It is caused by a type mismatch whilst building up a mapping for your app's
resources.arscfile.I strongly suspect it's just a compiler bug, and doubt you can fix it yourself besides waiting for a later compiler version (updating target API) where this will hopefully be fixed.
However, if you do want to dive deeper, I found this Chinese analysis (needs translating, search in page for
LoadedPackage::Load!) extremely detailed. It contains a high level description of theloadfunction, the file itself, and what the chunk loading actually means.It includes this helpful diagram, showing how all the parts interact, and specifically our
_TYPEparsing: