Crash: parameter must be a descendant of this view

1,101 views
Skip to first unread message

medioblogger

unread,
Jan 6, 2023, 6:06:50 AM1/6/23
to Google Mobile Ads SDK Developers
Hello!

After several months after having integrated the Unity Admob plugin, we are getting mostly in Android 11 but also Android 10 and 12 a lot crashes of the type:

Exception java.lang.Error: FATAL EXCEPTION Caused by: java.lang.IllegalArgumentException: parameter must be a descendant of this view

After researching the error and searching online, not only occurs in Unity, but also in other Admob plugins (React Native, etc.) According to forums one solution could be to add "AdView.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS)" to the Banner Adview, but from this plugin there is no access to the native Android code

Actually is the 35% of the crash rate in the Play Developer Console.

For reproduce the crash there is no code needed specifically, only have a banner enabled.

Here is the complete log:
Exception java.lang.Error: FATAL EXCEPTION
Caused by: java.lang.IllegalArgumentException: parameter must be a descendant of this view at android.view.ViewGroup.offsetRectBetweenParentAndChild (ViewGroup.java:6415) at android.view.ViewGroup.offsetDescendantRectToMyCoords (ViewGroup.java:6341) at android.view.ViewRootImpl.scrollToRectOrFocus (ViewRootImpl.java:4693) at android.view.ViewRootImpl.draw (ViewRootImpl.java:4229) at android.view.ViewRootImpl.performDraw (ViewRootImpl.java:4073) at android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:3331) at android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:2131) at android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:8605) at android.view.Choreographer$CallbackRecord.run (Choreographer.java:976) at android.view.Choreographer.doCallbacks (Choreographer.java:799) at android.view.Choreographer.doFrame (Choreographer.java:734) at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:961) at android.os.Handler.handleCallback (Handler.java:938) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loop (Looper.java:236) at android.app.ActivityThread.main (ActivityThread.java:8031) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:620) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1011)

Thanks

Mobile Ads SDK Forum Advisor

unread,
Jan 6, 2023, 1:25:02 PM1/6/23
to mediob...@gmail.com, google-adm...@googlegroups.com
Hi Medioblogger,

Thank you for raising this to us.

As per initially checking on the provided information, I didn't see any SDK symbols from the crash that you've provided. Since the issue is not locally reproducible, would it be possible for you to remove the unity plugin in your app, then monitor if the reported crash subsides? 

Regards,
Google Logo
Teejay Wennie
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2haPcr:ref

medioblogger

unread,
Jan 6, 2023, 10:44:25 PM1/6/23
to Google Mobile Ads SDK Developers
Hi
I understand that it is not easily reproducible, because it seems to be a design problem when the ad design is complex (maybe html5 I dont know), but it causes the browser viewer to claim focus and do the crash in the main app activity.

I’m not the only developer with this problem, here you have a link to github, with many users affected: 

Another link to unity forums:

And of course if I remove the plugin from my application the bug ceases to exist.

I know it’s no official, but when in the react-native plugin, they applied that patch the bug ceased to exist. 

Thank you very much for your support, and thank you for always giving us answers to our questions

Mobile Ads SDK Forum Advisor

unread,
Jan 9, 2023, 12:42:43 AM1/9/23
to mediob...@gmail.com, google-adm...@googlegroups.com

Hi,

 

Thank you for providing crash reference. For us to further check this crashes that is happening in your end, can you provide us more information below privately? You can provide the following details via reply privately to author option or directly provide it to the link below.

 

  • Sample app where the crashes is reproducible
  • Steps to replicate
  • Charles log (see instruction here
  • Device name and versions affected
  • SDK version

 

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=5004Q00002haPcrQAE&entry.80707362=00162717

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._5004Q2haPcr:ref

Liran Barsisa

unread,
Apr 18, 2024, 3:43:28 AM4/18/24
to Google Mobile Ads SDK Developers
Is the workaround helping?
Was there any progress in this?
It was closed here:
https://github.com/googleads/googleads-mobile-unity/issues/2353
But I don't get why, as I already use the latest version of Google ads:

implementation 'com.google.android.gms:play-services-ads:23.0.0'

Mobile Ads SDK Forum Advisor

unread,
Apr 18, 2024, 9:44:41 AM4/18/24
to lbl...@gmail.com, google-adm...@googlegroups.com

Hi Liran,

Could you confirm whether the mentioned issue is reproducible in our Google Sample Project as well? If yes, kindly share the below information privately so we can review it and try to replicate the problem. After doing so, we will be better equipped to offer a solution.

  • Sample Project reproducing the issue
  • Steps to replicate
  • Charles log
  • Devices affected

If the file(s) you are looking to share are less than 25mb, 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, kindly provide requested information to us via reply to author option or using the following steps:

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.!5004Q02haPcr:ref" (ADR-00162717)

Thanks,
 
Google Logo Mobile Ads SDK Team


Liran Barsisa

unread,
Apr 18, 2024, 1:41:48 PM4/18/24
to Google Mobile Ads SDK Developers
Hello Google,
The issue is reported on Crashlytics, by real users. I don't have many clues, but I've seen from the Crashlytics logs I've added that AdView was probably attached before each crash.
I can't provide you a sample for something that I can't reproduce myself.
However, I've noticed that there is a general issue that's related to scrolling, and so maybe AdView could be causing the crash in case it's a part of a scrolling container (such as NestedScrollView).
Someone even claimed that it might happen if you scroll while some View has focus, which might have triggered the keyboard:

Mobile Ads SDK Forum Advisor

unread,
Apr 19, 2024, 3:11:18 AM4/19/24
to lbl...@gmail.com, google-adm...@googlegroups.com

Hi Liran,

We need detailed debug information to investigate on this issue. As requested earlier, please try to provide the below details.

  • Sample Project reproducing the issue
  • Steps to replicate
  • Charles log

If the file(s) you are looking to share are less than 25mb, 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, kindly provide requested information to us via reply to author option or using the following steps:

Liran Barsisa

unread,
Apr 19, 2024, 4:34:52 AM4/19/24
to Google Mobile Ads SDK Developers
I can't. The app isn't open sourced, and I don't know what causes it.
It might be an Android bug, which AdView is just encouraging to occur.
There is NestedScrollView, and various kinds of Views in it, including AdView.
How can I know what exactly causes it, and how to prepare a sample for you? What would include this sample? Not just that, but as I wrote: It's by users. 
I don't know what triggers the crash. I only see the stacktrace.
Have you ever published an app for all users, that has Admob AdView being used ? You can't see such a thing for yourself?

Mobile Ads SDK Forum Advisor

unread,
Apr 19, 2024, 9:28:15 AM4/19/24
to lbl...@gmail.com, google-adm...@googlegroups.com
Hi,

I'm afraid that we'll need detailed debug information from a device where it's observed in order to actually make any progress in diagnosing this. As the issue is unable to reproduce, kindly share recent complete available stacktrace. Once provided, I'll be raising this to a wider team for further checking and to get their insight as well.

Muhammad Waqas

unread,
Apr 19, 2024, 9:21:03 PM4/19/24
to Google Mobile Ads SDK Developers
Update admib unity plugin. Resolved in admob unity 8.2.0
Reply all
Reply to author
Forward
0 new messages