googleads-mobile-unity: Admob Crash: Parameter must be a descendant of this view

[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)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 32 (3 by maintainers)

Commits related to this issue

Most upvoted comments

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

still getting crashes from users with these issue

Hi All, we confirmed Version admob v8.1.0 still have this issue: offsetRectBetweenParentAndChild:

xception java.lang.Error: FATAL EXCEPTION [main] Unity version : 2020.3.33f1 Device model : motorola moto e20 Device fingerprint: motorola/aruba/aruba:11/RON31.267-94/422c8:user/release-keys Build Type : Release Scripting Backend : IL2CPP ABI : armeabi-v7a Strip Engine Code : true

Caused by: java.lang.IllegalArgumentException: parameter must be a descendant of this view at android.view.ViewGroup.offsetRectBetweenParentAndChild (ViewGroup.java:6305) at android.view.ViewGroup.offsetDescendantRectToMyCoords (ViewGroup.java:6224) at android.view.ViewRootImpl.scrollToRectOrFocus (ViewRootImpl.java:4480) at android.view.ViewRootImpl.draw (ViewRootImpl.java:4046) at android.view.ViewRootImpl.performDraw (ViewRootImpl.java:3890) at android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:3152) at android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:2005) at android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:8236) at android.view.Choreographer$CallbackRecord.run (Choreographer.java:972) at android.view.Choreographer.doCallbacks (Choreographer.java:796) at android.view.Choreographer.doFrame (Choreographer.java:731) at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:957) at android.os.Handler.handleCallback (Handler.java:938) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loop (Looper.java:223) at android.app.ActivityThread.main (ActivityThread.java:7955) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:603) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:947)

@NVentimiglia Any solution of this crash? We are getting too many.