Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Webview crash on background due to 'visitLocalDescendants called on an unattached node'

168 views
Skip to first unread message

Thibault DENIS

unread,
Nov 4, 2024, 5:56:19 AM11/4/24
to Google Mobile Ads SDK Developers
Hello,

We are experiencing a new crash since mid-octobre (around 22k events on 2 weeks) in the Google Ad Manager interstitial, which seems to be related to the management of the WebView when the rendering process ends or is interrupted.

We believe we are in a case of memory saturation or a crash of the rendering process. It seems that Google Ad Manager correctly removes the WebView from the view hierarchy, but uses the onDetachedFromWindow callback to execute some JavaScript code. This script calls org.chromium.ui.base.ViewAndroidDelegate.requestFocus a little further in the code without checking if the view is still attached.

I've added a stacktrace of our crash. 

Changes made on our side at the same time:
Update webkit from 1.11.0 to 1.12.1

GAM version: 23.2.0 (nothing related to this crash in the release notes of the new versions)

Possible solution:
Implement a conditional check before each call to requestFocus in org.chromium.ui.base.ViewAndroidDelegate, to confirm that the view is attached but maybe the true issue is somewhere deeper and this fix will just hide it.

Thanks for you help,
Thibault
stacktrace.txt

Thibault DENIS

unread,
Nov 4, 2024, 4:01:52 PM11/4/24
to Google Mobile Ads SDK Developers
Hello,
We are experiencing a new crash since mid-octobre (around 22k events on 2 weeks) in the Google Ad Manager interstitial, which seems to be related to the management of the WebView when the rendering process ends or is interrupted.
We believe we are in a case of memory saturation or a crash of the rendering process. It seems that Google Ad Manager correctly removes the WebView from the view hierarchy, but uses the onDetachedFromWindow callback to execute some JavaScript code. This script calls org.chromium.ui.base.ViewAndroidDelegate.requestFocus a little further in the code without checking if the view is still attached.
I've added a stacktrace of our crash.

Changes made on our side at the same time:
- Update webkit from 1.11.0 to 1.12.1
- GAM version: 23.2.0 (nothing related to this crash in the release notes of the new versions)
stacktrace.txt

Mobile Ads SDK Forum Advisor

unread,
Nov 5, 2024, 12:20:21 AM11/5/24
to google-adm...@googlegroups.com
Hi,

Could you kindly share a sample project, so that we can have clear view of your implementation and provide solution.

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=5004Q00002vGhy1QAC&entry.80707362=00274237

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.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGhy1:ref" (ADR-00274237)

Thanks,
 
Google Logo Mobile Ads SDK Team


Simon Marquis

unread,
Nov 7, 2024, 8:28:44 AM11/7/24
to Google Mobile Ads SDK Developers
Hey Google Ads team, wake up!
This issue is once again gaining some speed (Nov. 5th) after your silently remotely fixed it last week (see the dip in the graph).
Here is a non-exhaustive list of affected versions we are seeing in our reports:
  • chromium-TrichromeWebViewGoogle6432.aab-stable-666810033:28
  • chromium-TrichromeWebViewGoogle6432.aab-stable-666810233:28
  • chromium-TrichromeWebViewGoogle6432.aab-stable-672305833:28
  • chromium-TrichromeWebViewGoogle6432.aab-stable-672306033:28
  • chromium-TrichromeWebViewGoogle6432.aab-stable-672308633:28

Screenshot 2024-11-07 at 11.35.40.png

> Could you kindly share a sample project, so that we can have clear view of your implementation and provide solution.
The bug is coming from our code, and we are unable to reproduce it with our test environment.

Mobile Ads SDK Forum Advisor

unread,
Nov 7, 2024, 12:21:23 PM11/7/24
to simon....@adevinta.com, google-adm...@googlegroups.com, thibaul...@adevinta.com

Hi Simon,

Thank you for sharing the progress and confirming that the issue isn't occuring in your test environment. I believe you are following Set up WebView guide for your implementation. Also, In order to make progress on this crash issue we would require the minimum sample project reproducing the issue. You can make use of Google Android sample apps as a reference. 

Simon Marquis

unread,
Nov 8, 2024, 5:58:58 AM11/8/24
to Google Mobile Ads SDK Developers
> The bug is coming from our code, and we are unable to reproduce it with our test environment.

I meant: is not coming from our code...

> Also, In order to make progress on this crash issue we would require the minimum sample project reproducing the issue. You can make use of Google Android sample apps as a reference.

As I said, we are not able to reproduce this on our side. Do you want me to submit an exact clone of your Android sample?

> I believe you are following Set up WebView guide for your implementation.

I'm not sure, I'll ask for confirmation, but I think we mainly use native (and interstitial) ads. The WebView traces that appears in the logs are coming directly from Google Mobile Ads SDKs own implantation.

Thibault DENIS

unread,
Dec 5, 2024, 3:52:16 AM12/5/24
to Google Mobile Ads SDK Developers

Hello,

Do you have any updates on this? This issue remains our most significant app crash, with over 84,000 occurrences since mid-October.

Additionally, we've observed an unusual pattern: between October 30th and November 4th, the number of crashes dropped significantly to around 100 per day. This is a sharp contrast to the average of approximately 2,300 crashes per day on other days.

Looking forward to hearing from you.

Thibault

Mobile Ads SDK Forum Advisor

unread,
Dec 5, 2024, 2:51:55 PM12/5/24
to thibaul...@adevinta.com

Hi Thibault,

  • As I said, we are not able to reproduce this on our side. Do you want me to submit an exact clone of your Android sample?
    • Yes, that would help that has the Update webkit from 1.11.0 to 1.12.1. You can make use of Google Android sample apps as a reference.  
  • I'm not sure, I'll ask for confirmation, but I think we mainly use native (and interstitial) ads. The WebView traces that appear in the logs are coming directly from Google Mobile Ads SDKs own implantation.
    • Confirmation would help Irrespective of the ad format being used. If your Android app utilizes WebView to display web content, it's recommended to configure it so that content can be optimally monetized with ads.

You can provide the following details via reply privately to the author option or directly provide it to the link below.



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=5004Q00002vGhy1QAC&entry.80707362=00274237

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. 

This message is in relation to case "ref:!00D1U01174p.!5004Q02vGhy1:ref" (ADR-00274237)


Thanks,
 
Google Logo Mobile Ads SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5



Thibault DENIS

unread,
Dec 9, 2024, 11:25:49 AM12/9/24
to Google Mobile Ads SDK Developers

Hello,

I have filled out the form using our app.
To trigger the ad:

  • Click the "Accepter et fermer" (accept and close) button.
  • Kill the application.
  • Relaunch the application.
  • Wait for the interstitial ad to appear (it will appear at every app launch).

As a reminder, this crash affects only a small portion of our users, and we have never been able to reproduce it. However, it remains the most significant crash in our application to date and has been persisting for over a month now.

Best regards,

Thibault DENIS.

Thibault DENIS

unread,
Jan 28, 2025, 8:14:35 AMJan 28
to Google Mobile Ads SDK Developers

Hello,

Do you have any updates on this? This issue remains our most significant app crash. 

Best regards,

Thibault DENIS.

Reply all
Reply to author
Forward
0 new messages