"parameter must be a descendant of this view" crash using Ads SDK in a React Native Android Application

3,483 views
Skip to first unread message

JAD

unread,
Dec 1, 2021, 4:29:34 AM12/1/21
to Google Mobile Ads SDK Developers
Please see this issue on the react-native GitHub project: https://github.com/facebook/react-native/issues/32649

It describes a new crash that started occurring around November 15th and has been reported by multiple developers whose React Native Android Apps are all using the Google Ads SDK but did not make or release any changes to their Apps to coincide with the appearance and frequency of this crash.

Please also note the comment just added that shows that the frequency of this crash is greatly reduced when we fully disabled Ads from being served to our App.


I know that the crash itself is being directly triggered from the React Native source at `com.facebook.react.uimanager.NativeViewHierarchyManager.updateLayout`

However it is the fact that this crash has started appearing out of nowhere without any changes on the client/App side, and that the crash is greatly reduced that suggests the cause may be a server side Ads related change.

Are you able to offer any insight here please?

Thanks

Mobile Ads SDK Forum Advisor

unread,
Dec 1, 2021, 9:35:57 AM12/1/21
to julian...@mixcloud.com, google-adm...@googlegroups.com
HI Jad,

Thank you for bringing this issue to our attention. In looking over this we would suggest that you post this in the react native forums. We do not offer support for React Native. If you should happen to see. any issue with Android Studio, Unity or Flutter within regards to Android. We will be more than happy to help.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2RxfC0:ref

JAD

unread,
Dec 14, 2021, 7:17:55 AM12/14/21
to Google Mobile Ads SDK Developers
Just to provide a quick update in case it is useful to others, we have found that the crash can be prevented by calling `setDescendantFocusability` on the `AdManagerAdView` and passing `FOCUS_BLOCK_DESCENDANTS` 

i.e. `adView.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);`

More details in the React Native GitHub issue linked above.

Mobile Ads SDK Forum Advisor

unread,
Dec 14, 2021, 11:35:34 PM12/14/21
to julian...@mixcloud.com, google-adm...@googlegroups.com

Hi Jad,

Thank you for sharing this to the rest who are using Ads SDK with React Native Android development. Kindly note that we can only provide proper context to you with regard to the following platform that our Google Mobile Ads SDK are supported. If you have any concerns related to the platform supported, kindly let us know.

Regards,

Google Logo
Princess Pamela Pineda
Mobile Ads SDK Team
 

 

ref:_00D1U1174p._5004Q2RxfC0:ref

Blue Ocean

unread,
Jan 4, 2022, 10:12:12 PM1/4/22
to Google Mobile Ads SDK Developers
We have also experienced similar problems.
We do not use React Native. ( CoordinatorLayout is used as root layout. )


Our stack traces are: ( Google Play console & Crashlytics )

Fatal Exception: java.lang.IllegalArgumentException: parameter must be a descendant of this view
       at android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:6081)
       at android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:6010)
       at android.view.ViewRootImpl.scrollToRectOrFocus(ViewRootImpl.java:3639)
       at android.view.ViewRootImpl.draw(ViewRootImpl.java:3229)
       at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3154)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2523)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1494)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7288)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
       at android.view.Choreographer.doCallbacks(Choreographer.java:761)
       at android.view.Choreographer.doFrame(Choreographer.java:696)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
       at android.os.Handler.handleCallback(Handler.java:873)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:193)
       at android.app.ActivityThread.main(ActivityThread.java:6923)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870)


This crash has been completely resolved after calling 'AdView.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS)'. ( See the attached screenshot )
Because the log contains only ViewGroup and ViewRootImpl, it is not easy to find out that this crash occurs by AdView ( actually by WebView ).

Sorry. We do not have additional information except this log.
crash_graph.jpg

Mobile Ads SDK Forum Advisor

unread,
Jan 5, 2022, 2:12:35 AM1/5/22
to dev.pho...@gmail.com, google-adm...@googlegroups.com

Hi Blue,

Thank you for reaching out to us.

Can you share with us your sample project file where this error is happening? This will help us to check it further. Rest assured that the shared project file will not be shared externally and will be used for investigation purposes only just kindly provide it privately. You can send it via Reply privately to author option or send it directly to mobileads...@gmail.com. Kindly inform us on this thread if you sent it directly to the email provided.

rooi...@gmail.com

unread,
Jan 25, 2022, 5:38:13 PM1/25/22
to Google Mobile Ads SDK Developers

We are having this same exception with similar stack:

  at android.view.ViewGroup.offsetRectBetweenParentAndChild (ViewGroup.java:6061)
  at android.view.ViewGroup.offsetDescendantRectToMyCoords (ViewGroup.java:5990)
  at android.view.ViewRootImpl.scrollToRectOrFocus (ViewRootImpl.java:3789)
  at android.view.ViewRootImpl.draw (ViewRootImpl.java:3367)
  at android.view.ViewRootImpl.performDraw (ViewRootImpl.java:3285)
  at android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:2782)
  at android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:1718)
  at android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:7513)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1066)
  at android.view.Choreographer.doCallbacks (Choreographer.java:878)
  at android.view.Choreographer.doFrame (Choreographer.java:794)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1052)
  at android.os.Handler.handleCallback (Handler.java:790)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:210)
  at android.app.ActivityThread.main (ActivityThread.java:7080)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:523)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:863)

But we are using Unity.
And interestingly, seems to be happening only on Android 11 devices. (100% Android 11)

Mobile Ads SDK Forum Advisor

unread,
Jan 26, 2022, 2:54:27 AM1/26/22
to rooi...@gmail.com, google-adm...@googlegroups.com
Hi Painman,

Could you please provide a sample project where the issue is reproducible? You can send it via Reply privately to author option or send it directly to mobileads...@gmail.com. Kindly inform us on this thread if you sent it directly to the email provided.

Regards,
Google Logo
Teejay Wennie Pimentel
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2RxfC0:ref

Alex

unread,
Jul 20, 2022, 10:37:49 AM7/20/22
to Google Mobile Ads SDK Developers
Any news regarding this bug? Still too many crashes. Here's some fixes: https://github.com/facebook/react-native/issues/32649
But I'm using unity Admbob SDK and still have crashes.

среда, 26 января 2022 г. в 09:54:27 UTC+2, mobileadssdk:

Mobile Ads SDK Forum Advisor

unread,
Jul 20, 2022, 2:00:47 PM7/20/22
to mrsh...@gmail.com, google-adm...@googlegroups.com
Hi Alex,

Can you reproduce this crash in one of our slightly modified samples? Note that we only support a native Unity to iOS or Android SDK integration.

Regards,

Google Logo
Aryeh
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2RxfC0:ref

Alex

unread,
Jul 20, 2022, 3:38:29 PM7/20/22
to Google Mobile Ads SDK Developers
Hi Aryeh,

I can't reproduce this crash on my devices, but I can see the error on the live projects.
Here's the stacktrace:
"Caused by java.lang.IllegalArgumentException
parameter must be a descendant of this view
keyboard_arrow_up
arrow_right
android.view.ViewGroup.offsetRectBetweenParentAndChild (ViewGroup.java:6152)
android.view.ViewGroup.offsetDescendantRectToMyCoords (ViewGroup.java:6081)
android.view.ViewRootImpl.scrollToRectOrFocus (ViewRootImpl.java:3801)
android.view.ViewRootImpl.draw (ViewRootImpl.java:3378)
android.view.ViewRootImpl.performDraw (ViewRootImpl.java:3303)
android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:2653)
android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:1572)
android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:7632)
android.view.Choreographer$CallbackRecord.run (Choreographer.java:1034)
android.view.Choreographer.doCallbacks (Choreographer.java:845)
android.view.Choreographer.doFrame (Choreographer.java:780)
android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1020)
android.os.Handler.handleCallback (Handler.java:873)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loop (Looper.java:205)
android.app.ActivityThread.main (ActivityThread.java:6993)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:884)"


As for your modified sample, I can see UnityEvents instead of direct function calls and this doesn't fix the issue. It just produce more errors.
MobileAdsEventExecutor.ExecuteInUpdate also doen't fix the issue.
I tried these on one of my project.

среда, 20 июля 2022 г. в 21:00:47 UTC+3, mobileadssdk:

Mobile Ads SDK Forum Advisor

unread,
Jul 21, 2022, 2:14:06 AM7/21/22
to mrsh...@gmail.com, google-adm...@googlegroups.com

Hi Alex,

Thank you for your response.

Can you provide the complete stack traces with information from all threads and the Unity version you're using? Also, can you confirm if you have inspected your code implementation and verify if any of them might have caused a crash?

Regards,

Google Logo
Princess Pamela
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2RxfC0:ref

Alex

unread,
Jul 21, 2022, 6:20:38 AM7/21/22
to Google Mobile Ads SDK Developers
Hi Princess Pamela,

Stacktrace from Crashlytics attached to this message.

Regards,
Alex.


четверг, 21 июля 2022 г. в 09:14:06 UTC+3, mobileadssdk:
stacktrace.txt

Mobile Ads SDK Forum Advisor

unread,
Jul 21, 2022, 11:15:26 AM7/21/22
to mrsh...@gmail.com, google-adm...@googlegroups.com

Hi Alex,

Thank you for sharing your full stack trace on this. But upon checking it, I don't see what version of our SDK for unity you're using on this. We requesting it so that we know what version this crashes is happening.

Alex

unread,
Jul 21, 2022, 11:57:39 AM7/21/22
to Google Mobile Ads SDK Developers
Here is is: Google Mobile Ads Unity Plugin v7.1.0
Also I'm using libraries for mediation:
AppLovin 6.3.0
UnityAds 3.2.1
Ironsource 2.2.2
Meta 3.8.0
четверг, 21 июля 2022 г. в 18:15:26 UTC+3, mobileadssdk:

Mobile Ads SDK Forum Advisor

unread,
Jul 21, 2022, 9:22:13 PM7/21/22
to mrsh...@gmail.com, google-adm...@googlegroups.com
Hi Alex,

Thank you for providing the requested information. I've relayed to this the rest of the team for further investigation. I'll update this thread the soonest they share their findings.

Regards,
Google Logo
Teejay Wennie
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2RxfC0:ref

Mike Hardy

unread,
Sep 19, 2022, 9:54:06 AM9/19/22
to Google Mobile Ads SDK Developers
Interesting - I just came over here from a related issue in react-native-google-mobile-ads (https://github.com/invertase/react-native-google-mobile-ads/issues/230) and it turns out that the workaround of setting 'AdView.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS)' prevents crashes but apparently blocks rich media ads from having working inputs.

I recognize the immediate response from a maintainer will be that a react-native issue is not valid but there are pure-java reproduction notes above, so this looks like a real issue in the SDK

It would be nice to have an update here, it was mentioned the internal team has the information relayed and we're awaiting updates?

Mobile Ads SDK Forum Advisor

unread,
Sep 20, 2022, 1:32:03 AM9/20/22
to mi...@mikehardy.net, google-adm...@googlegroups.com

Hi Mike,

Thank you for reaching out to us.

Can you confirm if you're able to encounter also the crashes that was mentioned on this thread? If yes, can you provide us the following details below so that we can also share it to the rest of the team for additional information on this, as they are currently investigating this? You can provide it at the link below.

  • Sample app project
  • Steps to replicate
  • Full stack trace
  • 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=5004Q00002RxfC0QAJ&entry.80707362=00087535

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

Mobile Ads SDK Forum Advisor

unread,
Mar 17, 2023, 3:08:30 PM3/17/23
to mrsh...@gmail.com, google-adm...@googlegroups.com

Hi Alex,

I hope you're doing well.

I just want to circle back with regard to the crashes that you're encountering in your Crashlytics report using Google Mobile Ads Unity Plugin v7.1.0. Our team suggested to update to the latest Unity plugin. Feel free to reach back to us if you still encounter this in the latest version.

Regards,

Google Logo Mobile Ads SDK Team


ref:_00D1U1174p._5004Q2RxfC0:ref

medioblogger

unread,
May 4, 2023, 5:43:09 PM5/4/23
to Google Mobile Ads SDK Developers
Hello
I can confirm that the issue still exist in the most recent version of the plugin (8.0.0 and 8.1.0). The crash rate are insane in the latest update and some devs are getting penalized by Android Vitals in Google Play.

They put a commit with the fix for the version 8.1.0 and delete it a few hours before the release (without an explanation).

After more than 5 months the issue still opened and there is no response:

There is no need to reproduce any test project. Only use the plugin in production in whatever way you want.

Please, commit again the fix, there are many people who are getting hurt in their apps and downloads this crash that has an easy solution, this is bad for the devs and for Google. Thanks.

Mobile Ads SDK Forum Advisor

unread,
May 5, 2023, 2:57:05 AM5/5/23
to mediob...@gmail.com, google-adm...@googlegroups.com
Hello,

Please provide us the Complete Stack Traces/Crash Logs of these crashes so we may forward this to team for further investigation.

You can provide the following details via reply privately to 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=5004Q00002RxfC0QAJ&entry.80707362=00087535

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,

medioblogger

unread,
May 5, 2023, 3:50:46 AM5/5/23
to Google Mobile Ads SDK Developers
I Have submitted the stacktrace and more info privately. Thanks again.

Trefle Game

unread,
May 8, 2023, 12:27:33 AM5/8/23
to Google Mobile Ads SDK Developers
Hi Admin,

It happens the same here in Google Mobile Ads Unity Plugin v8.1.0
I saw someone said in Jan 2022: 
"This crash has been completely resolved after calling 'AdView.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS)'. ( See the attached screenshot )
Because the log contains only ViewGroup and ViewRootImpl, it is not easy to find out that this crash occurs by AdView ( actually by WebView )."

Can we have this fix or at least AdView public access in Google Mobile Ads Unity Plugin in next version?

admobException.jpg

medioblogger

unread,
May 8, 2023, 4:49:35 AM5/8/23
to Google Mobile Ads SDK Developers
Hi
They have pushed a commit for the next version of the plugin with the fix!: 
Now it only remains to hope that they do not take long to release the next version! 

Mobile Ads SDK Forum Advisor

unread,
May 8, 2023, 7:51:57 AM5/8/23
to mediob...@gmail.com, google-adm...@googlegroups.com
Hello,

For clarification, do you have any further concerns or inquiries with regards to this issue?

medioblogger

unread,
May 8, 2023, 10:51:09 AM5/8/23
to Google Mobile Ads SDK Developers
Hello

No, I will wait to this commit to be merge in the main branch and (I hope finally) release in the next version to end with this long issue.

Thanks for your help and patience!

Mobile Ads SDK Forum Advisor

unread,
May 24, 2023, 8:35:52 AM5/24/23
to mediob...@gmail.com, google-adm...@googlegroups.com
Hello everyone,

Please be informed that the issue reported here has been fixed on the latest unity version which you can find here: https://github.com/googleads/googleads-mobile-unity/releases/tag/v8.2.0.
 
This message is in relation to case "ref:_00D1U1174p._5004Q2RxfC0:ref"

Thanks,

 
Google Logo Mobile Ads SDK Team


Reply all
Reply to author
Forward
0 new messages