请投票给问题跟踪器 https://issuetracker.google.com/issues/330368298
我刚刚通过查看 Firebase Crashlytics 注意到我的应用程序发生了一些崩溃,这似乎与尝试使用SharedPreferences
但由于强制转换异常而无法获得首选项的 Google AdMob 库相关:
代码文字:
Fatal Exception: java.lang.ClassCastException
java.lang.Integer cannot be cast to java.lang.String
android.app.SharedPreferencesImpl.getString (SharedPreferencesImpl.java:302)
com.google.android.gms.ads.internal.scionintegration.a.onSharedPreferenceChanged (:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:73)
com.google.android.gms.ads.internal.scionintegration.m.a (:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:106)
com.google.android.gms.ads.nonagon.a.s (:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:439)
com.google.android.gms.ads.nonagon.a.b (:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:5)
com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl.getMobileAdsSettingManager (:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:52)
com.google.android.gms.ads.internal.client.bx.bR (:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:40)
m.ajn.onTransact (:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:21)
android.os.Binder.transact (Binder.java:1173)
obj.gL (:com.google.android.gms@[email protected] (190400-607434947):8)
com.google.android.gms.ads.internal.client.ay.getMobileAdsSettingManager (:com.google.android.gms@[email protected] (190400-607434947):12)
com.google.android.gms.ads.MobileAdsSettingManagerCreatorImpl.getMobileAdsSettingManager (:com.google.android.gms@[email protected] (190400-607434947):42)
com.google.android.gms.ads.internal.client.az.fL (:com.google.android.gms@[email protected] (190400-607434947):40)
obk.onTransact (:com.google.android.gms@[email protected] (190400-607434947):101)
android.os.Binder.transact (Binder.java:1173)
com.google.android.gms.internal.ads.zzavg.zzbh (com.google.android.gms:play-services-ads-base@@22.6.0:1)
com.google.android.gms.ads.internal.client.zzcp.zze (zzcp.java:169)
com.google.android.gms.ads.internal.client.zzeq.zza (zzeq.java:169)
com.google.android.gms.ads.internal.client.zzaq.zzc (com.google.android.gms:play-services-ads-lite@@22.6.0:169)
com.google.android.gms.ads.internal.client.zzax.zzf (com.google.android.gms:play-services-ads-lite@@22.6.0:126)
com.google.android.gms.ads.internal.client.zzax.zzd (com.google.android.gms:play-services-ads-lite@@22.6.0:126)
com.google.android.gms.ads.internal.client.zzej.zzA (com.google.android.gms:play-services-ads-lite@@22.6.0:17)
com.google.android.gms.ads.internal.client.zzej.zzm (zzej.java:53)
com.google.android.gms.ads.MobileAds.initialize (com.google.android.gms:play-services-ads-lite@@22.6.0:53)
com.MY_APP_PACKAGE.ads.AdMob.initAdmob (AdMob.kt:128)
有人有这个问题吗?
我还有其他使用 22.6.0 版本 Admob 的应用程序,我没有注意到它们发生此类崩溃,而对于这个应用程序,它只发生在 6 个用户(约 23 万用户)中,但仍然......为什么会发生这种情况......
更新:
发现其他人也出现同样的问题:https ://groups.google.com/g/google-admob-ads-sdk/c/88UHAaWElsc
更新2:
现在我遇到了更多崩溃,现在它影响了其他应用程序
ps 另外,Admob Dashboard API 今天也关闭了,所以 mb 这是相关的
临时解决方案:如果您为应用程序设置了 Firebase Remote Config 以禁用广告,MobileAds.initialize()
如果您添加了特定参数,这也会阻止调用。不幸的是,就我而言,我只有参数来启用/禁用应用程序屏幕上的广告类型(横幅、插页式广告),但没有参数来阻止加载同意信息(UMP 库)和MobileAds.initialize()
,但我现在会添加它以供将来使用案例...
谷歌正在积极调查此次事故,并声称问题已经得到解决。您可以在此处找到更多详细信息: https://ads.google.com/status/publisher/incidents/ZDDr9AsgkrNxd7zHjU4c ?hl=en