Fixed
Status Update
Comments
an...@google.com <an...@google.com> #3
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 Koala | 2024.1.1 Canary 8
- Android Gradle Plugin 8.5.0-alpha08
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!
Description
The manifest merger does not track intent-filter elements correctly, such that most elements' locations just map to the first identical element, even if there is just one manifest. The parent elements need to be taken into account. For example, many intent filters will include
<category android:name="android.intent.category.DEFAULT" />
, but the location of these will all map back to the first instance of this element, even for different intent-filters and different activities.The merged manifest viewer in Studio has a workaround where child elements of
<intent-filter>
just use the location information from the<intent-filter>
element. Intent-filters are identified by the concatenation of all child elements, so this works fairly well, except for identical intent-filters across different activities (the parent needs to be included as well). Thus, even in the manifest viewer, the nth version of a duplicate intent filter always maps back to the first instance, even across different activities. Also, tools like Lint need to report incidents on the child elements, and these just get mapped back incorrectly to the first element, even for very different intent filters.I think I have a fix.
Sample manifest. Note that even with my fix, duplicate intent filters under the same activity (or under <queries>) still map back to the first instance at that nesting level; I think this is OK, as these elements cannot really be distinguished, and so are actually redundant.