The App Bundles thread was getting a bit long and branch-y, so I’ll mention AAPT2 stuff here.
I ran my large project with UseAAPT2 enabled and got the correct error messages about needing to rename .android-xml files to .xml. After doing this, I encountered a new error running aapt2:
E: The filename or extension is too long
D: | at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo).
This immediately follows the call to aapt2.exe, which in my project was given 344 full-path items, the total command length being ~44k characters. Not sure to what degree this is limited, but it looks like aapt2 may need to be called multiple times after all…
Yeah, I expected this, Windows has limits of howe many parameters can be passed to a process :(. does aapt2 on windows support passing @somefile.txt and reading the parameters from the file instead, like many other tools do? Or does it have an alternative parameter where a single file with a list of filenames can be passed?
Looks like the only option, with the mentioned caveat, is
--dir directory Specifies the directory to scan for resources.
Although you can use this flag to compile multiple resource files with one command, it disables the benefits of incremental compilation and thus, should not be used for large projects.
I wonder how the incremental processing is supposed to work — dopes aapt2 handle that on its own, or is it meant that we check which files have changed, and only call aapt2 for the ones that have changed? (which will be tricky of we also want to handle removals & co).
I suggest I switch to --dir for now, and ignore incremental processing, since we’re caching the aapt2 run anyways, sop it wukld only run if there had been changes to the resources (but if there is a change, it will, for now re-process all). and we can see if we wanna fine-tune that with more granular caching, later?
Fixed, on Windows I’ll just run individually for each file, on Unix I’ll run a single command. I also did add checks to only incrementally run for tis exiles that have changed, and to only link if needed, as well.
Myself, I’m still stuck on aapt2 link not liking there manifest file, even though it looks correct to me…