Skip to content

Commit c98074e

Browse files
authored
Merge pull request #174 from HereLiesAz/claude/fix-mobileads-provider-launch-crash
Fix launch force-close: strip MobileAdsInitProvider from base manifest
2 parents ea42f02 + 5a8c9f3 commit c98074e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

app/src/main/AndroidManifest.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@
4040
android:name="com.google.android.gms.fonts.API_KEY"
4141
android:value="${FONTS_API_KEY}" />
4242

43+
<!-- The Google Mobile Ads SDK lives in the on-demand :feature:ads split. AGP promotes its
44+
auto-init MobileAdsInitProvider into the BASE manifest (tagged splitName="ads"), but some
45+
devices still instantiate it at process start when the ads split isn't installed, hitting
46+
a ClassNotFoundException and force-closing on launch. We initialize the SDK explicitly
47+
(AdsFeatureImpl.initialize), so strip the auto-init provider from the base manifest. -->
48+
<provider
49+
android:name="com.google.android.gms.ads.MobileAdsInitProvider"
50+
android:authorities="${applicationId}.mobileadsinitprovider"
51+
tools:node="remove"
52+
tools:ignore="MissingClass" />
53+
4354
<!-- AdMob APPLICATION_ID meta-data now lives in the :feature:ads module manifest. -->
4455

4556
<activity

0 commit comments

Comments
 (0)