Status Update
Comments
fr...@dbdigital.in <fr...@dbdigital.in> #2
com.google.android.gms.ads.internal.scionintegration.a.onSharedPreferenceChanged (:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:73)
com.google.android.gms.ads.internal.scionintegration.m.a (:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:106)
com.google.android.gms.ads.nonagon.a.s (:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:439)
com.google.android.gms.ads.nonagon.a.b (:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:5)
com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl.getMobileAdsSettingManager (:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:52)
m.ajn.onTransact (:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:21)
android.os.Binder.transact (Binder.java:1188)
ocm.gL (:com.google.android.gms@240812039@24.08.12 (190408-608507424):8)
com.google.android.gms.ads.internal.client.ay.getMobileAdsSettingManager (:com.google.android.gms@240812039@24.08.12 (190408-608507424):12)
com.google.android.gms.ads.MobileAdsSettingManagerCreatorImpl.getMobileAdsSettingManager (:com.google.android.gms@240812039@24.08.12 (190408-608507424):42)
com.google.android.gms.ads.internal.client.az.fL (:com.google.android.gms@240812039@24.08.12 (190408-608507424):40)
ocn.onTransact (:com.google.android.gms@240812039@24.08.12 (190408-608507424):101)
android.os.Binder.transact (Binder.java:1188)
com.google.android.gms.internal.ads.zzaoj.zzbs (com.google.android.gms:play-services-ads-base@@20.6.0:2)
com.google.android.gms.internal.ads.zzbic.zze (zzbic.java:4)
com.google.android.gms.internal.ads.zzbjv.zza (zzbjv.java:3)
com.google.android.gms.internal.ads.zzbgg.zzc (com.google.android.gms:play-services-ads-lite@@20.6.0:12)
com.google.android.gms.internal.ads.zzbgn.zzf (com.google.android.gms:play-services-ads-lite@@20.6.0:1)
com.google.android.gms.internal.ads.zzbgn.zzd (com.google.android.gms:play-services-ads-lite@@20.6.0:11)
com.google.android.gms.internal.ads.zzbjq.zzv (com.google.android.gms:play-services-ads-lite@@20.6.0:3)
com.google.android.gms.internal.ads.zzbjq.zzl (com.google.android.gms:play-services-ads-lite@@20.6.0:8)
com.google.android.gms.ads.MobileAds.initialize (com.google.android.gms:play-services-ads-lite@@20.6.0:3)
lk...@ourgroceries.com <lk...@ourgroceries.com> #3
co...@wetter.com <co...@wetter.com> #4
Happens across multiple App versions, devices and Android versions.
oz...@gmail.com <oz...@gmail.com> #5
I'd say that it's possibly because the static string key saved on the shared prefs is used somewhere else, even in a different library perhaps, as an Integer. Couldn't fully recover the string name though because of the compiled code. Haven't delve much in though
oz...@gmail.com <oz...@gmail.com> #6
It's a bit hard to understand where's the problem is as the code is obfuscated but it should be one of these:
"gad_has_consent_for_cookies"
"IABTCF_gdprApplies"
"IABTCF_TCString"
"IABTCF_PurposeConsents"
I don't know who exactly causes this crash but I know that the "getString" function crash when one of them returns an integer instead of string.
The getString function crashes somewhere here:
public final void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String str) {
char c;
int i;
zzbbc zzbbcVar = zzbbk.zzay;
C6158t c6158t = C6158t.f15178d;
if (((Boolean) c6158t.f15181c.zzb(zzbbcVar)).booleanValue()) {
if (zzbwv.zza(str, "gad_has_consent_for_cookies")) {
if (!((Boolean) c6158t.f15181c.zzb(zzbbk.zzaw)).booleanValue()) {
return;
}
int i2 = sharedPreferences.getInt("gad_has_consent_for_cookies", -1);
C6482j0 c6482j0 = (C6482j0) this.zzc;
c6482j0.m973p();
synchronized (c6482j0.f16228a) {
i = c6482j0.f16242o;
}
if (i2 != i) {
((C6482j0) this.zzc).m982g(true);
}
((C6482j0) this.zzc).m984e(i2);
return;
} else if (zzbwv.zza(str, "IABTCF_gdprApplies") || zzbwv.zza(str, "IABTCF_TCString") || zzbwv.zza(str, "IABTCF_PurposeConsents")) {
String string = sharedPreferences.getString(str, "-1");
if (string != null && !string.equals(((C6482j0) this.zzc).m965x(str))) {
((C6482j0) this.zzc).m982g(true);
}
((C6482j0) this.zzc).m983f(str, string);
return;
} else {
return;
}
}
String string2 = sharedPreferences.getString("IABTCF_PurposeConsents", "-1");
int i3 = sharedPreferences.getInt("gad_has_consent_for_cookies", -1);
String valueOf = String.valueOf(str);
int hashCode = valueOf.hashCode();
if (hashCode != -2004976699) {
if (hashCode == -527267622 && valueOf.equals("gad_has_consent_for_cookies")) {
c = 1;
}
c = 65535;
} else {
if (valueOf.equals("IABTCF_PurposeConsents")) {
c = 0;
}
c = 65535;
}
if (c != 0) {
if (c != 1) {
return;
}
if (((Boolean) c6158t.f15181c.zzb(zzbbk.zzaw)).booleanValue() && i3 != -1 && this.zzf != i3) {
this.zzf = i3;
zzb(string2, i3);
}
} else if (!string2.equals("-1") && !this.zze.equals(string2)) {
this.zze = string2;
zzb(string2, i3);
}
}
where the str argument is one of the static strings I mentioned. Notice that Google does lots of type/null checks before communicating with the SharedPreferences so this seems like something that the developers tried to avoid
oz...@gmail.com <oz...@gmail.com> #7
Again, I could be wrong. My assumptions are heavily relayed on lots of obfuscated code
si...@gmail.com <si...@gmail.com> #8
On an old build of com.google.android.gms.policy_ads_fdr_dynamite
(211512000057.367949677.367949677 July 15, 2021), there are 2 potential culprits:
public final void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String str) {
Context context;
if ("IABTCF_PurposeConsents".equals(str)) {
String string = sharedPreferences.getString("IABTCF_PurposeConsents", "");
public final void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String str) {
char c;
if ("consent_string".equals(str)) {
String string = sharedPreferences.getString("consent_string", "");
I have a strong feeling that IABTCF_PurposeConsents
is the one we are crashing on.
From the documentation:
Binary String
: The'0'
or'1'
at position n – where n's indexing begins at0
– indicates the consent status for purpose ID n+1;false
andtrue
respectively. eg.'1'
at index0
is consenttrue
for purpose ID1
Something in the chain might have replaced this value thinking it was an Integer
🙈.
oz...@gmail.com <oz...@gmail.com> #9
```
val prefs = PreferenceManager.getDefaultSharedPreferences(this)
try {
prefs.getString("consent_string", "")
} catch (e: ClassCastException) {
prefs.edit().putString("consent_string", "").apply()
}
MobileAds.initialize(this) {}
```
oz...@gmail.com <oz...@gmail.com> #10
oz...@gmail.com <oz...@gmail.com> #11
oz...@gmail.com <oz...@gmail.com> #12
Sorry. This is the complete solution we have until now:
val prefs = PreferenceManager.getDefaultSharedPreferences(this)
try {
prefs.getString("consent_string", "")
} catch (e: ClassCastException) {
prefs.edit().putString("consent_string", "").apply()
}
try {
prefs.getString("IABTCF_PurposeConsents", "")
} catch (e: ClassCastException) {
prefs.edit().putString("IABTCF_PurposeConsents", "").apply()
}
MobileAds.initialize(this) {}
oz...@gmail.com <oz...@gmail.com> #13
I advice against using this solution though. I don't think you're suppose to touch the consent finals. This message only meant to help point to the right solution
st...@gmail.com <st...@gmail.com> #14
no...@gmail.com <no...@gmail.com> #15
8h...@gmail.com <8h...@gmail.com> #16
I guess the team has to undo the recent remote changes on Admob server side ASAP
se...@gmail.com <se...@gmail.com> #17
Any Google update on this? Some config change on AdMob servers?
(don't think we should be altering GDPR strings as stated above...)
no...@gmail.com <no...@gmail.com> #18
lk...@ourgroceries.com <lk...@ourgroceries.com> #19
al...@pyde.tech <al...@pyde.tech> #20
Is there anyone on Crashlytics who is seeing a decrease in crashes? (I'm not)
Crashes stopped between 01:04-01:14 GMT but they appeared again after that interval for me.
to...@gmail.com <to...@gmail.com> #21
ro...@gmail.com <ro...@gmail.com> #22
aa...@spoonlabs.com <aa...@spoonlabs.com> #23
I just released a new version with try-catch.
co...@hotmail.com <co...@hotmail.com> #25
gu...@gmail.com <gu...@gmail.com> #26
sh...@gmail.com <sh...@gmail.com> #27
hj...@gmail.com <hj...@gmail.com> #28
the status page doesnt include any technical details.
I just hope that they fixed the issue in a robust way.
th...@gmail.com <th...@gmail.com> #29
Google said it was resolved, but many crashes are still being reported.
th...@wemoms.fr <th...@wemoms.fr> #30
do...@teknasyon.com <do...@teknasyon.com> #31
ra...@google.com <ra...@google.com> #32
Related API or developer doc.
Android bug report (to be captured after reproducing the issue)
For steps to capture a bug report, please refer:
Alternate method
Navigate to “Developer options”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Note: Please upload the bug report to google drive and share the folder to android-bugreport@google.com, then share the link here.
no...@gmail.com <no...@gmail.com> #34
st...@gmail.com <st...@gmail.com> #35
ju...@besoccer.com <ju...@besoccer.com> #36
lk...@ourgroceries.com <lk...@ourgroceries.com> #37
Rats, I added try/catch
around the MobileAds.initialize()
call, released it, but the crash is still happening! It's in a callback as a result of shared preferences changing:
Fatal Exception: java.lang.ClassCastException
java.lang.Integer cannot be cast to java.lang.String
android.app.SharedPreferencesImpl.getString (SharedPreferencesImpl.java:306)
com.google.android.gms.ads.internal.scionintegration.a.onSharedPreferenceChanged (:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:73)
android.app.SharedPreferencesImpl$EditorImpl.notifyListeners (SharedPreferencesImpl.java:693)
android.app.SharedPreferencesImpl$EditorImpl.lambda$notifyListeners$0$android-app-SharedPreferencesImpl$EditorImpl (SharedPreferencesImpl.java:699)
android.app.SharedPreferencesImpl$EditorImpl$$ExternalSyntheticLambda0.run (Unknown Source:4)
android.os.Handler.handleCallback (Handler.java:942)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loopOnce (Looper.java:226)
android.os.Looper.loop (Looper.java:313)
android.app.ActivityThread.main (ActivityThread.java:8762)
Any ideas how to defend against that?
st...@gmail.com <st...@gmail.com> #38
no...@gmail.com <no...@gmail.com> #39
Referring to the posts above, the problem is that the saved type of iab consent strings of the initially affected users was somewhat corrupted.
Google needs to restore these corrupted iab consent strings to their original state,
but I'm worried that they may have omitted this part.
na...@gmail.com <na...@gmail.com> #40
at android.app.SharedPreferencesImpl.getString(SharedPreferencesImpl.java:302)
at com.google.android.gms.ads.internal.scionintegration.a.onSharedPreferenceChanged(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:73)
at com.google.android.gms.ads.internal.scionintegration.m.a(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:106)
at com.google.android.gms.ads.nonagon.a.s(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:439)
at com.google.android.gms.ads.nonagon.a.b(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:5)
at com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl.getMobileAdsSettingManager(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:52)
at
at m.ajn.onTransact(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:21)
at android.os.Binder.transact(Binder.java:1169)
at ocm.gL(:com.google.android.gms@240812038@24.08.12 (190400-608507424):8)
at com.google.android.gms.ads.internal.client.ay.getMobileAdsSettingManager(:com.google.android.gms@240812038@24.08.12 (190400-608507424):12)
at com.google.android.gms.ads.MobileAdsSettingManagerCreatorImpl.getMobileAdsSettingManager(:com.google.android.gms@240812038@24.08.12 (190400-608507424):42)
at com.google.android.gms.ads.internal.client.az.fL(:com.google.android.gms@240812038@24.08.12 (190400-608507424):40)
at ocn.onTransact(:com.google.android.gms@240812038@24.08.12 (190400-608507424):101)
at android.os.Binder.transact(Binder.java:1169)
at com.google.android.gms.internal.ads.zzato.zzbg(SourceFile:8)
at com.google.android.gms.ads.internal.client.zzcp.zze(SourceFile:15)
at com.google.android.gms.ads.internal.client.zzeq.zza(SourceFile:15)
at com.google.android.gms.ads.internal.client.zzaq.zzc(SourceFile:109)
at com.google.android.gms.ads.internal.client.zzax.zzf(SourceFile:1)
at com.google.android.gms.ads.internal.client.zzax.zzd(SourceFile:93)
at com.google.android.gms.ads.internal.client.zzej.zzA(SourceFile:15)
at com.google.android.gms.ads.internal.client.zzej.zzn(SourceFile:49)
at com.google.android.gms.ads.MobileAds.initialize(SourceFile:3)
at com.viber.voip.ViberApplication.lambda$doInitApplication$16(SourceFile:889)
at com.viber.voip.ViberApplication.x(SourceFile:1)
at com.viber.voip.y1.init(SourceFile:1)
at u20.f.initInstance(SourceFile:3)
at u20.d.b(SourceFile:16)
at u20.d.run(SourceFile:1)
at d00.j1.run(SourceFile:1)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
at d00.i1.run(SourceFile:1)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
ra...@google.com <ra...@google.com> #41
Please provide the requested information mentioned in
se...@gmail.com <se...@gmail.com> #42
ra...@google.com <ra...@google.com> #43
Thanks for the information. We are closing this issue as this forum is for reporting Android issues only. For Google Mobile Ads issues, please visit the
Description
Initializing Google Mobile Ads SDK leads to runtime crashs.
We are currently counting ~60k crashes for ~10k users since today at 2pm (CET).
It happens on multiple apps/device/OS, multiple versions of Google Mobile Ads SDK, multiple versions of Google Play Services.
This looks like a Google Play Service remote configuration issue.
The stacktrace cause is: Caused by java.lang.ClassCastException java.lang.Integer cannot be cast to java.lang.String
And here is an example of a full stacktrace: