我正在我的应用中投放广告,我需要在我的应用中支持 AdMob 中介和 DFP(针对发布商的双击)广告。我认为我做的一切都是正确的,我包含了(新的)AdMob SDK,以及来自此网址的所有其他发布商 SDK 和适配器:
https://developers.google.com/mobile-ads-sdk/ad-network-mediation
然后我创建了一个新DfpAdView
的这样的:
final DfpAdView ad = new DfpAdView(this, AdSize.BANNER, /* my ad id here */);
adView.addView(ad);
ad.loadAd(new AdRequest());
当我提出广告请求时,出现以下异常:
09-05 09:16:00.703: E/Ads(10863): Cannot find adapter class 'GADMAdapterCustomEvents'. Did you link the ad network's mediation adapter? Skipping ad network.
09-05 09:16:00.703: E/Ads(10863): java.lang.ClassNotFoundException: GADMAdapterCustomEvents
09-05 09:16:00.703: E/Ads(10863): at java.lang.Class.classForName(Native Method)
09-05 09:16:00.703: E/Ads(10863): at java.lang.Class.forName(Class.java:217)
09-05 09:16:00.703: E/Ads(10863): at java.lang.Class.forName(Class.java:172)
09-05 09:16:00.703: E/Ads(10863): at com.google.ads.g.a(SourceFile:133)
09-05 09:16:00.703: E/Ads(10863): at com.google.ads.i.run(SourceFile:116)
09-05 09:16:00.703: E/Ads(10863): at android.os.Handler.handleCallback(Handler.java:615)
09-05 09:16:00.703: E/Ads(10863): at android.os.Handler.dispatchMessage(Handler.java:92)
09-05 09:16:00.703: E/Ads(10863): at android.os.Looper.loop(Looper.java:137)
09-05 09:16:00.703: E/Ads(10863): at android.app.ActivityThread.main(ActivityThread.java:4745)
09-05 09:16:00.703: E/Ads(10863): at java.lang.reflect.Method.invokeNative(Native Method)
09-05 09:16:00.703: E/Ads(10863): at java.lang.reflect.Method.invoke(Method.java:511)
09-05 09:16:00.703: E/Ads(10863): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-05 09:16:00.703: E/Ads(10863): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-05 09:16:00.703: E/Ads(10863): at dalvik.system.NativeStart.main(Native Method)
09-05 09:16:00.703: E/Ads(10863): Caused by: java.lang.NoClassDefFoundError: GADMAdapterCustomEvents
09-05 09:16:00.703: E/Ads(10863): ... 14 more
09-05 09:16:00.703: E/Ads(10863): Caused by: java.lang.ClassNotFoundException: GADMAdapterCustomEvents
09-05 09:16:00.703: E/Ads(10863): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
09-05 09:16:00.703: E/Ads(10863): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
09-05 09:16:00.703: E/Ads(10863): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
09-05 09:16:00.703: E/Ads(10863): ... 14 more