Closed NiaNingXue closed 3 years ago
It's probably happens because you add MediaView directly into Activity root layout (ViewRootImpl). Create some child layout under ViewRootImpl, for example, FragmentLayout and add MediaView inside this layout. It should fix the issue.
I also have this issue. I checked what @gwheet said, but all my MediaViews are inside ConstraintLayouts. This is my stack trace:
Fatal Exception: java.lang.ClassCastException: android.view.ViewRootImpl cannot be cast to android.view.ViewGroup
at com.facebook.ads.redexgen.X.b5.A0I(b5.java:68031)
at com.facebook.ads.redexgen.X.5F.registerViewForInteraction(5F.java:13636)
at com.facebook.ads.redexgen.X.5F.registerViewForInteraction(5F.java:13644)
at com.facebook.ads.NativeAd.registerViewForInteraction(NativeAd.java:5)
at com.google.ads.mediation.facebook.rtb.FacebookRtbNativeAd.trackViews(FacebookRtbNativeAd.java:2)
at com.google.android.gms.internal.ads.zzart.zzx(zzart.java:20)
at com.google.android.gms.internal.ads.zzaqp.zzbA(zzaqp.java:8)
at com.google.android.gms.internal.ads.zzhx.onTransact(zzhx.java:20)
at android.os.Binder.transact(Binder.java:675)
at gc.bb(gc.java:2)
at com.google.android.gms.ads.internal.mediation.client.q.x(q.java)
at com.google.android.gms.ads.nonagon.ad.nativead.cl.a(cl.java:23)
at com.google.android.gms.ads.nonagon.ad.nativead.ak.h(ak.java:4)
at com.google.android.gms.ads.nonagon.ad.nativead.ak.g(ak.java:2)
at com.google.android.gms.ads.nonagon.ad.nativead.bj.d(bj.java:6)
at com.google.android.gms.ads.internal.formats.client.k.bA(k.java:26)
at gd.onTransact(gd.java:4)
at android.os.Binder.transact(Binder.java:675)
at com.google.android.gms.internal.ads.zzhw.zzbj(zzhw.java:7)
at com.google.android.gms.internal.ads.zzahm.zzd(zzahm.java:8)
at com.google.android.gms.ads.nativead.NativeAdView.setNativeAd(NativeAdView.java:8)
at com.rodxander.bloodpressureapp.ad.AppAdsManager.populateNativeAdView(AppAdsManager.java:144)
at com.rodxander.bloodpressureapp.ui.base.BaseActivity.lambda$showAd$1(BaseActivity.java:2)
at com.rodxander.bloodpressureapp.ui.base.-$$Lambda$BaseActivity$TJ5or2Bst9qHurP0CqODtmlHuBo.run(-.java:2)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7156)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
Hi @RodXander. I am getting the same crash. Did you resolve the issue?
hi, I am also getting the same crash...
Facing the same issue, has anyone got any fix for this?
facebook-sdk is so terrible!
Hi, I update the audience network sdk to 6.2.1, crash happens on many users' devices, include android 6.0 - android 10. The previous version I use is 5.11.0 and has no this issue.