googleads-mobile-android-mediation icon indicating copy to clipboard operation
googleads-mobile-android-mediation copied to clipboard

ClassCastException: com.google.ads.mediation.chartboost.ChartboostAdapter cannot be cast to com.google.android.gms.ads.mediation.OnContextChangedListener

Open ber4444 opened this issue 6 years ago • 1 comments

I believe ChartboostAdapter should implement OnContextChangedListener with an empty implementation of onContextChanged(Context c), otherwise code like this will throw the above exception:

    @Override
    public void onResume() {
        super.onResume();
        Chartboost.onResume(this);
        if (rewardedVideoAd!=null) rewardedVideoAd.resume(MainActivity.this);
    }

Note that is code is a mix of what there is already in your sample (rewardedVideoAd.resume), and what https://developers.google.com/admob/android/mediation/chartboost recommends doing (Chartboost.onResume).

ber4444 avatar Sep 26 '18 17:09 ber4444

Please confirm: this exception is just logged as a warning. The app doesn't crash because of this, correct?

ericleich avatar Oct 26 '18 19:10 ericleich