Skip to content

Commit ac3276c

Browse files
authored
Add a tools:remove rule to the discovery service definition. (#2563)
The removal is needed to satisfy the manifest merger when it merges manifests across dynamic feature modules into the base app. Since each Firebase SDK has a discovery service definition in its manifest, placing them into a dynamic feature adds `android:splitName="featureName"` to the discovery service. Subsequent merge into the main app manifest causes a conflict since the splitName is different in each feature. Note that this change is also moving the dynamic module support registrar definition to `firebase-dynamic-module-support` since having an `android:remove` in `firebase-common` produces a warning when the app does not use dynamic feature modules. To avoid this warning, the manifest entry will now live in the dynamic module support sdk, since it's only expected to be used if the host app uses dynamic features. http://b/184263558
1 parent 98f7de8 commit ac3276c

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

firebase-common/src/main/AndroidManifest.xml

+1-6
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@
3030
android:name="com.google.firebase.components.ComponentDiscoveryService"
3131
android:directBootAware="true"
3232
android:exported="false"
33-
tools:targetApi="n">
34-
<!--This registrar is not defined in the dynamic-module-support sdk itself to allow non-firebase
35-
clients to use it as well, by defining this registrar in their own core/common library.-->
36-
<meta-data android:name="com.google.firebase.components:com.google.firebase.dynamicloading.DynamicLoadingRegistrar"
37-
android:value="com.google.firebase.components.ComponentRegistrar" />
38-
</service>
33+
tools:targetApi="n" />
3934
</application>
4035
</manifest>

firebase-components/firebase-dynamic-module-support/src/main/AndroidManifest.xml

+12
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,16 @@
1818
package="com.google.firebase.dynamicloading">
1919
<!--Although the *SdkVersion is captured in gradle build files, this is required for non gradle builds-->
2020
<!--<uses-sdk android:minSdkVersion="14"/>-->
21+
22+
<application>
23+
<service
24+
android:name="com.google.firebase.components.ComponentDiscoveryService"
25+
android:exported="false"
26+
tools:remove="android:splitName">
27+
<!-- The above splitName removal is necessary to avoid manifest merge conflicts
28+
when more than one dynamic-feature module depends on Firebase libraries. -->
29+
<meta-data android:name="com.google.firebase.components:com.google.firebase.dynamicloading.DynamicLoadingRegistrar"
30+
android:value="com.google.firebase.components.ComponentRegistrar" />
31+
</service>
32+
</application>
2133
</manifest>

0 commit comments

Comments
 (0)