Status Update
Comments
je...@google.com <je...@google.com>
al...@google.com <al...@google.com> #2
I guess the main point here is to not produce aapt_friendly_merged_manifests for debug as we need it only for release and when "non name-spaced".
@Jedo, is my assumption correct?
This artifact (type AAPT_FRIENDLY_MERGED_MANIFESTS) is generated by ProcessLibraryManifest the same task that creates PACKAGED_MANIFESTS. So need to land fix there.
al...@google.com <al...@google.com>
al...@google.com <al...@google.com> #3
ProcessLibraryManifest task produces MERGED_MANIFEST,PACKAGED_MANIFEST and AAPT_FRIENDLY_MERGED_MANIFESTS. PACKAGED_MANIFEST is always the same as for merged one for libraries and task just creates pointer to it in metadata.json and does not write the Manifest file itself (which is causing caching issues down the road
In some cases Packaged and AAPT manifests are equal to merged manifest. But because of Gradle caching system and configuration phase (need to declare inputs and outputs before we know about details) we have to keep copies of manifest in declared folder. This was discussed with @jedo
After some digging into code I found that AAPT manifest generation has extra iterations over DOM model - that can be optimized.
Overall Manifest merger code look fairly old (no lambdas or streams) so perhaps it makes sense to migrate it to Kotlin. I think that Kotlin nullability will be useful for Merger API.
al...@google.com <al...@google.com>
xa...@google.com <xa...@google.com> #4
thanks for looking into this Alex.
sa...@google.com <sa...@google.com> #5
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Electric Eel Beta 4 (2022.1.1.14)
- Android Gradle Plugin 7.4.0-beta04
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
sa...@google.com <sa...@google.com> #6
Further fixes for this issue are now available in:
- Android Studio Flamingo Canary 7 (2022.2.1.7)
- Android Gradle Plugin 8.0.0-alpha07
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Description
Using a basic project with 1 app and 1 lib, using AGP 7.4.0 alpha 2, we see the following manifest files after a build:
The fact that we have 3 intermediate manifests in the app and (more importantly) 2 in the library is probably something we can optimize, in some cases.
The most important aspect here is the library as we need this for scaling. If the reason to have 2 is something we can put behind an opt-in feature that would be better.