AMP only uses AAPT (1). AAPT2 has been available since Android 24
https://developer.android.com/studio/command-line/aapt2
The resource value file in AndroidX.savedState has a structure that cannot be parsed by AAPT.
I suspect there will be others.
AAPT2 explicitly splits resource packaging into compiling and linking (which we knew needed to be done because AMP invokes it twice, once in GenerateResources and once when packaging an AAR/APK)
We need to
- Split the AaptPackageCommandBuilder into Compile and Link classes or maybe just constructable based on command.
- Move all Aapt classes into an aapt package
- Create Aapt2 versions
- Have factory choose which classes to use, based on whether AAPT2 exists in build tools folder
- Update all clients.