googleads-mobile-android-mediation
googleads-mobile-android-mediation copied to clipboard
MopubAdapter - ClassCastException
Hi,
Since Mopub mediation adapter v5.4.1.2 a ClassCastException
occurs while loading native ads. As b124a760c5c5b9667b4cabd12d56d674f9f1c56e
a modification has been made during Mopub SDK initialization where now the Context is cast to an Activity, which is not necessary in this case (native ads) as the Mopub SDK already checks if the Context is an Activity only to handle Rewarded Videos.
For now I keep the previous version (5.4.1.1) that works for native ads with an Application Context, but it would be nice to keep the Context as it is without casting it, at least for native ads.
Thanks
Agree, it is a bit unexpected, because admob InterstitalAd class doesn't need Activity context, but then you got runtime exception because MoPub does.
Hi All,
Tried on my end and I was not able to see any ClassCastException in the logs when loading any ad format. Can you try using the latest 5.7.1.0 MoPub adapter and see if you can see the exception popping up? If so, then kindly share with us device logs for us to investigate further.
@joshuajplagonera That happened when I pass ApplicationContext instead of Activity in AdLoader.Builder(), I can confirm it happened on 5.7.1.0 also.