Random crashes caused by IndexOutOfBoundsException at ViewTreeObserver$CopyOnWriteArray$Access.get

354 views
Skip to first unread message

dase...@gmail.com

unread,
Jun 17, 2022, 5:34:18 AM6/17/22
to Google Mobile Ads SDK Developers
Hello.

After a recent update of our app (which bumped AdMob from v20.4.0 to v20.6.0, among other library updates), we have been getting new crashes caused by an 
 java.lang.IndexOutOfBoundsException exception that cannot be caught because it occurs in the Android framework.

It seems to happen quite randomly on our main game Activity (where we have a banner with auto-refresh). We cannot reproduce it.

We suspect it's somehow caused by the AdMob Android SDK, because:
- the ad-free version of the app has no such crash
- we found a dev with a similar issue which happens when their app shows an interstitial (https://stackoverflow.com/questions/67821711/indexoutofboundsexception-in-viewtreeobserver)

It impacts multiple versions of our app, running AdMob/firebase-ads version 20.6.0 and 21.0.0.
All versions of Android seem to be impacted (from 4 to 12).

The stack trace:
Fatal Exception: java.lang.IndexOutOfBoundsException
Index: 7, Size: 7

java.util.ArrayList.get (ArrayList.java:437)
android.view.ViewTreeObserver$CopyOnWriteArray$Access.get (ViewTreeObserver.java:1308)
android.view.ViewTreeObserver.dispatchOnGlobalLayout (ViewTreeObserver.java:1087)
android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:3745)
android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:2618)
android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:9971)
android.view.Choreographer$CallbackRecord.run (Choreographer.java:1010)
android.view.Choreographer.doCallbacks (Choreographer.java:809)
android.view.Choreographer.doFrame (Choreographer.java:744)
android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:995)
android.os.Handler.handleCallback (Handler.java:938)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loop (Looper.java:246)
android.app.ActivityThread.main (ActivityThread.java:8625)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)

Our ad SDK dependencies:
'com.google.android.gms:play-services-ads:21.0.0'
'com.google.ads.mediation:gadopenwrapadapter:1.1.1'
'com.pubmatic.sdk:openwrap:2.6.0'
'com.google.ads.mediation:verizonmedia:1.14.0.0'
'com.smaato.android.sdk:admob-banner-adapter:21.6.7'
'com.smaato.android.sdk:admob-interstitial-adapter:21.6.7'
'com.google.ads.mediation:fyber:8.1.3.0'
'com.amazon.android:aps-sdk:9.4.2'
'com.amazon.android:aps-admob-adapter:2.0.3'
'com.google.ads.mediation:facebook:6.11.0.0'
'com.google.ads.mediation:inmobi:10.0.6.0'
'com.google.ads.mediation:applovin:11.4.0.0'
'com.google.ads.mediation:ironsource:7.2.1.0'

Any help with this issue will be much appreciated!

Mobile Ads SDK Forum Advisor

unread,
Jun 21, 2022, 9:13:00 AM6/21/22
to dase...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for reaching out to us.

For us to further check this, can you provide us the additional information below? You can provide it directly to the link below.

  • Sample app project
  • Steps to replicate

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002bxMDbQAM&entry.80707362=00111347
2. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

Regards,

Google Logo
Princess Pamela
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2bxMDb:ref

dase...@gmail.com

unread,
Jun 23, 2022, 5:43:13 AM6/23/22
to Google Mobile Ads SDK Developers
Hi,

We don't know how to reproduce this issue, it's just one of these tricky production crashes that we only have some Crashlytics logs for.

Mobile Ads SDK Forum Advisor

unread,
Jun 23, 2022, 10:36:18 AM6/23/22
to dase...@gmail.com, google-adm...@googlegroups.com

Hi,

In looking over the logs, I've seen that there are no symbols that indicate that this crash is related to the Mobile Ads SDK. Can you confirm if this is the only logs that you get in your Crashlytics logs?

Sébastien Leclerc

unread,
Jun 23, 2022, 10:59:59 AM6/23/22
to Mobile Ads SDK Forum Advisor, google-adm...@googlegroups.com
Yes, this is the full stack trace provided by Crashlytics.

You are right that there is no proof that it's caused by the Mobile Ads SDK, yet I have a strong suspicion that it is.

Mobile Ads SDK Forum Advisor

unread,
Jun 24, 2022, 4:33:17 AM6/24/22
to dase...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for confirming that this is the full stack trace you get from Crashlytics. However, we needed more information for us to further investigate these crashes. It would be best if you could provide a project instead, so we could have full visibility in your implementation as well. If you can't still provide a project file, you may modify our Sample App Android aligning to your implementation. This will be a big help to us for investigation.

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002bxMDbQAM&entry.80707362=00111347
2. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

Regards,

Reply all
Reply to author
Forward
0 new messages