I got FC about drt_ts in my preference

27 views
Skip to first unread message

400

unread,
Jan 15, 2014, 12:05:09 PM1/15/14
to google-adm...@googlegroups.com
My app can backup and restore preference.
after I restore preference ,app will crash if admob show ads.
and finally I found this.
drt_ts is added by admob in my preference, but i change his type. and I got FC.

admob sdk:GoogleAdMobAdsSdk-6.4.1.jar
logcat:
 E/AndroidRuntime(20837): java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
 E/AndroidRuntime(20837):     at android.app.SharedPreferencesImpl.getLong(SharedPreferencesImpl.java:247)
 E/AndroidRuntime(20837):     at com.google.ads.at.a(SourceFile:140)
 E/AndroidRuntime(20837):     at com.google.ads.at.a(SourceFile:121)
 E/AndroidRuntime(20837):     at com.google.ads.internal.d.a(SourceFile:597)
 E/AndroidRuntime(20837):     at com.google.ads.AdView.loadAd(SourceFile:575)

Eric Leichtenschlag

unread,
Jan 17, 2014, 9:33:19 PM1/17/14
to google-adm...@googlegroups.com
Hello,

It sounds like your app is backing up the AdMob-stored preferences and restoring them as well, but is resorting drt_ts as an int instead of a long. So when the SDK goes to load an ad and check that parameter, it's calling getLong on shared preferences, but shared preferences has an int, and shared preferences can't cast the Integer object to a Long. Your app should write this preference back as a <long> instead of an <int>.

Thanks,
Eric
Reply all
Reply to author
Forward
0 new messages