AdvertisingIdClient unexpected exception

2,888 views
Skip to first unread message

ZsuiwaL ZsuiwaL

unread,
May 16, 2016, 12:31:54 PM5/16/16
to Google Mobile Ads SDK Developers
Hello,
I have an Android app which uses AdMob SDK. I recently got the following crash report:
Fatal Exception: java.util.concurrent.TimeoutException: com.google.android.gms.ads.identifier.AdvertisingIdClient.finalize() timed out after 10 seconds
       at java.lang.Object.wait(Object.java)
       at java.lang.Object.wait(Object.java:401)
       at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
       at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
       at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:170)
       at java.lang.Thread.run(Thread.java:856)

It occurred on Samsung gt_s7275r device with Android 4.2.2.
What's more, the app crashed in the background (so banner ad was invisible).
I don't know whether it is a bug inside the SDK or Dalvik runtime, hopefully you'll know better ;)

Vu Chau (Mobile Ads SDK Team)

unread,
May 16, 2016, 3:22:08 PM5/16/16
to Google Mobile Ads SDK Developers
Hi there,

Thanks for letting us know about this.

Do you happen to have reproducible steps so that we can replicate the crash locally?  Is there anything "special" (compared to our vanilla sample) that you are doing in your ad-related code that you think might be causing the crash?

One more question: Are you using other ad SDKs in your app as well?

Vu Chau
Mobile Ads SDK Team

ZsuiwaL ZsuiwaL

unread,
May 16, 2016, 4:12:32 PM5/16/16
to Google Mobile Ads SDK Developers
I got the crash report from a single user and she/he didn't post any details. The only thing I know is that the app was in the background when the crash occurred, perhaps the user just closed main activity containing AdView banner. I wasn't able to reproduce this problem neither on real 4.2.2 device nor an emulator.
The first thing which came to my mind was my Activity#onDestroy() implementation, but the code related to AdView really doesn't differ from given example (like in the sample I call AdView#destroy()).
PS: AdMob is the only advertising SDK I use.
PPS: Here's more detailed crash report (with stack traces from all threads) in case it helps: http://crashes.to/s/9e72d56837a

Vu Chau (Mobile Ads SDK Team)

unread,
May 16, 2016, 5:07:31 PM5/16/16
to Google Mobile Ads SDK Developers
Hi there,

Thanks for the extra details! 

To me, it looks like the SDK might have problems trying to set the Advertising ID during initialization for its own use.  If you check the docs for the Advertising ID, it states:
Users can reset their advertising ID or opt out of interest-based ads at any time, right from the Google Settings app. 
 and 
Apps making use of the advertising ID must check for and respect the user's ad tracking preference. 
which makes me come to a hypothesis: either the user was tampering with the Advertising ID himself/herself, or some other frameworks/libs in your build were doing that.  In either case, if not done properly, those actions might place a lock on the ID, causing other frameworks (most relevant, those for advertisement) a hard time trying to finalize / get a hold of it.  

I recommend walking through the rest of your code to see if anything is manipulating this ID.  For now, I'm going to keep this ticket open.  If other developers run into the same exception, feel free to post the details.  That will help us troubleshoot the issue further.

Thanks,

Vu Chau
Mobile Ads SDK Team

Andrei Tanascu

unread,
Jun 17, 2016, 10:22:24 AM6/17/16
to Google Mobile Ads SDK Developers
Hello,

So if I understand correctly this Advertising ID belongs to the AdMob SDK. However I just saw this crash on an app that does not use AdMob. We actually have no ad sdk whatsoever. So where does this AdvertisingIdClient come from ?

Thanks,
Andrei

Vu Chau (Mobile Ads SDK Team)

unread,
Jun 17, 2016, 4:18:59 PM6/17/16
to Google Mobile Ads SDK Developers
Hi Andrei,

Do you have a stack trace?  Checking the call stack should reveal from where the crash originates.

Vu Chau
Mobile Ads SDK Team

Andrei Tanascu

unread,
Jun 20, 2016, 6:25:06 AM6/20/16
to Google Mobile Ads SDK Developers
I added the call stack. But I don't see anything that could help find the cause, maybe you can make something out of it. The only play-services apis I use are gcm, maps and location

Fatal Exception: java.util.concurrent.TimeoutException: com.google.android.gms.ads.identifier.AdvertisingIdClient.finalize() timed out after 10 seconds
       at java.lang.Thread.currentThread(Thread.java:470)
       at java.lang.ThreadLocal.get(ThreadLocal.java:53)
       at android.os.Looper.myLooper(Looper.java:180)
       at com.google.android.gms.common.internal.zzx.zzcy(Unknown Source)
       at com.google.android.gms.ads.identifier.AdvertisingIdClient.finish(Unknown Source)
       at com.google.android.gms.ads.identifier.AdvertisingIdClient.finalize(Unknown Source)
       at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:187)
       at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:170)
       at java.lang.Thread.run(Thread.java:841)

Vu Chau (Mobile Ads SDK Team)

unread,
Jun 20, 2016, 2:43:14 PM6/20/16
to Google Mobile Ads SDK Developers
Hi Andrei,

Thanks for the stack trace.  I have relayed it to the rest of the team, and we will investigate it further.  Once there is an update, you will hear back from one of us.

Vu Chau
Mobile Ads SDK Team

Vu Chau (Mobile Ads SDK Team)

unread,
Jul 22, 2016, 1:53:07 PM7/22/16
to Google Mobile Ads SDK Developers
Hi Andrei,

The bug has been fixed in Google Play services v9.4.  The new version is rolling out, so be sure to continue monitoring the release schedule for updates!

Vu Chau
Mobile Ads SDK Team

tami...@opensooq.com

unread,
Feb 18, 2017, 7:56:00 PM2/18/17
to Google Mobile Ads SDK Developers
I still facing this problem
Fatal Exception: java.util.concurrent.TimeoutException: com.google.android.gms.ads.identifier.AdvertisingIdClient.finalize() timed out after 10 seconds
       at android.os.BinderProxy.destroy(Binder.java)
       at android.os.BinderProxy.finalize(Binder.java:459)
       at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:187)
       at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:170)
       at java.lang.Thread.run(Thread.java:841)

my Google Play service version is 9.8.0 

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Feb 21, 2017, 12:00:44 PM2/21/17
to Google Mobile Ads SDK Developers
Hi there,

I have forwarded this again to the team and I would like to request the following info on this - 
  • Crashyltics/complete crash logs.
  • Charles logs.
  • Your App link.
  • Code snippets of your implementation.
Thanks,
Arjun Busani
Mobile Ads SDK Team
Reply all
Reply to author
Forward
0 new messages