AdMob crash: The specified child already has a parent. You must call removeView() on the child's parent first.

49 views
Skip to first unread message

Andrey K

unread,
May 21, 2024, 12:26:38 PMMay 21
to Google Mobile Ads SDK Developers
Hello Google AdMob Ads SDK Team,

I have recently migrated from `AdManager` to `AdMob` and started using `AdView` instead of `AdManagerView` in my android app.

Unfortunatelly, I started receiving the next crashes:
```
Exception: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
       at android.view.ViewGroup.addViewInner(ViewGroup.java:5505)
       at android.view.ViewGroup.addView(ViewGroup.java:5324)
       at android.view.ViewGroup.addView(ViewGroup.java:5264)
       at android.view.ViewGroup.addView(ViewGroup.java:5236)
       at com.google.android.gms.ads.internal.mraid.f.b(:com.google.android.gms.policy_ads_fdr_dynamite@241199803@241199801034.618989241.618989241:30)
       at com.google.android.gms.ads.internal.mraid.f.a(:com.google.android.gms.policy_ads_fdr_dynamite@241199803@241199801034.618989241.618989241:47)
       at com.google.android.gms.ads.internal.webview.r.d(:com.google.android.gms.policy_ads_fdr_dynamite@241199803@241199801034.618989241.618989241:52)
       at com.google.android.gms.ads.internal.webview.ag.destroy(:com.google.android.gms.policy_ads_fdr_dynamite@241199803@241199801034.618989241.618989241:32)
       at com.google.android.gms.ads.internal.webview.y.run(:com.google.android.gms.policy_ads_fdr_dynamite@241199803@241199801034.618989241.618989241:3)
       at android.os.Handler.handleCallback(Handler.java:958)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at m.azn.a(:com.google.android.gms.policy_ads_fdr_dynamite@241199803@241199801034.618989241.618989241:1)
       at com.google.android.gms.ads.internal.util.f.a(:com.google.android.gms.policy_ads_fdr_dynamite@241199803@241199801034.618989241.618989241:2)
       at m.azn.dispatchMessage(:com.google.android.gms.policy_ads_fdr_dynamite@241199803@241199801034.618989241.618989241:1)
       at android.os.Looper.loopOnce(Looper.java:230)
       at android.os.Looper.loop(Looper.java:319)
       at android.app.ActivityThread.main(ActivityThread.java:8893)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
```

I use 'com.google.android.gms:play-services-ads:23.0.0'.
Unfortunately, I cannot reproduce this issue on my device. It happens just for 1%-2% of my users and I don't know how to reproduce it.

Some stats:
Devices
76%
Samsung
11%
Xiaomi
4%
Google
3%
Huawei
6%
Other (7)
OS
67%
Android 14
11%
Android 11
9%
Android 13
8%
Android 10
5%
Other (2)

1. I wonder if you could deobfuscate the stack trace, find the problematic line of code and add a fix "remove parent ViewGroup"?
2. As I mentioned, I have recently migrated from `AdManager` to `AdMob` account. I'd be interested to know if I could continue using `AdManagerView` for AdMob ads? I didn't have such an issue using `AdManagerView`.

Look forward to hearing from you and will appreciate any help!

Mobile Ads SDK Forum Advisor

unread,
May 22, 2024, 2:17:19 AMMay 22
to kotkov...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for contacting the Mobile Ads SDK Support team.

I see that same concern on another Forum thread with the subject 'Google Banner Admob crash: The specified child already has a parent. You must call removeView() on the child's parent first' , and we have already responded there for this issue. To avoid multiple threads on the same issue, please take a look at that thread and continue the discussion on the same for further updates on the issue.
 

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

Thanks,
 
Google Logo Mobile Ads SDK Team

 

Reply all
Reply to author
Forward
0 new messages