请投票给问题跟踪器 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:
现在我遇到了更多崩溃,现在它影响了其他应用程序
附注另外,今天Admob Dashboard API 已关闭,所以 mb 与此相关
临时解决方案:如果您为应用设置了 Firebase 远程配置来禁用广告,如果您添加了特定参数,这也会阻止调用
MobileAds.initialize()
。不幸的是,就我而言,我只有参数来启用/禁用应用程序屏幕上的广告类型(横幅、插页式广告),但没有参数来阻止加载同意信息(UMP 库)和 MobileAds.initialize()
,但我现在将添加它对于未来的情况...
谷歌正在积极调查该错误,并声称该问题已得到解决。 您可以在这里找到更多详细信息: https://ads.google.com/status/publisher/incidents/ZDDr9AsgkrNxd7zHjU4c?hl=zh-CN