通过admob的第三方sdk集成正在抛出Classcast异常

时间:2017-07-17 12:02:39

标签: admob classcastexception mobile-ad-mediation

我正在尝试使用 admob mediation 整合第三方sdk。

广告网络已为其提供适配器。就我看初始化日志而言,SDK已正确初始化。但是根据广告请求,它会给出以下异常:

Instantiating mediation adapter: com.google.ads.mediation.customevent.CustomEventAdapter
Could not request interstitial ad from adapter.
java.lang.ClassCastException: com.google.ads.mediation.nexage.NexageAdapter cannot be cast to com.google.ads.mediation.customevent.CustomEventInterstitial
    at com.google.ads.mediation.customevent.CustomEventAdapter.requestInterstitialAd(Unknown Source)
    at com.google.ads.mediation.customevent.CustomEventAdapter.requestInterstitialAd(Unknown Source)
    at com.google.android.gms.internal.zzfj.zza(Unknown Source)
    at com.google.android.gms.internal.zzey$zza.onTransact(Unknown Source)
    at android.os.Binder.transact(Binder.java:387)
    at com.google.android.gms.ads.internal.mediation.client.g.a(:com.google.android.gms.DynamiteModulesA:115)
    at com.google.android.gms.ads.internal.mediation.g.a(:com.google.android.gms.DynamiteModulesA:117)
    at com.google.android.gms.ads.internal.mediation.e.run(:com.google.android.gms.DynamiteModulesA:34)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7229)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Could not request ad from mediation adapter.

我对此进行了很多搜索,但找不到任何帮助。

1 个答案:

答案 0 :(得分:0)

找到了例外的原因。 这是因为广告设置不正确而发生的。没有提到正确的包装名称。

谢谢,