question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Admob Crash: Parameter must be a descendant of this view

See original GitHub issue

[REQUIRED] Step 1: Describe your environment

  • Unity version: 2021.3.11f1 2021.3.12f1
  • Google Mobile Ads Unity plugin version: v7.3.0
  • Platform: Android
  • Platform OS version: 12, 11, 10
  • Any specific devices issue occurs on: Multiple devices
  • Mediation ad networks used, and their versions: None

[REQUIRED] Step 2: Describe the problem

After several months after having integrated this 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

Steps to reproduce:

Use the app normally with a banner enabled

Relevant Code:

Crash example:

Exception java.lang.Error: FATAL EXCEPTION [main]
Unity version     : 2021.3.11f1
Device model      : Xiaomi M2101K7BL
Build Type        : Release
Scripting Backend : IL2CPP
ABI               : arm64-v8a
Strip Engine Code : true

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)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:32 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MuhammadWaqasOfficialcommented, May 19, 2023

still getting crashes from users with these issue

Which version do you use? Google announced that 8.2.0 has fixed this issue. https://github.com/googleads/googleads-mobile-unity/releases/tag/v8.2.0

fixed in 8.2.0, https://github.com/googleads/googleads-mobile-unity/issues/2646#issuecomment-1552393175

1reaction
DevDreams12commented, May 16, 2023

still getting crashes from users with these issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash: parameter must be a descendant of this view
Hello! After several months after having integrated the Unity Admob plugin, we are getting mostly in Android 11 but also Android 10 and...
Read more >
Crash : java.lang.IllegalArgumentException at ViewGroup. ...
Admob : 7.0.2. Firebase: 9.0.0. java.lang.IllegalArgumentException: parameter must be a descendant of this view at android.view.ViewGroup.
Read more >
Bug - Android crash on Unity 2019.4.26f | Page 2
florianpenzkofer Here are some images about this crash, ... Admob Crash: Parameter must be a descendant of this view · Issue #2353 ...
Read more >
Bug - Android crash on Unity 2019.4.26f
Hi there, I got crashes on Android 7.0 & 7.1. ... at android.view.ViewGroup. ... parameter must be a descendant of this view. android.view....
Read more >
parameter must be a descendant of this view in ViewGroup ...
Hi, I am using Android SDK 1.5. I am developing an activity with multiple content views. It will call setContentView() with different viewgroup...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found