googleads / googleads-mobile-android-mediation

Sample Android project showcasing how to build a mediation adapter or custom event for the Google Mobile Ads SDK.
Apache License 2.0
242 stars 198 forks source link

SmartBanners not working #296

Open DeliriumCode opened 4 years ago

DeliriumCode commented 4 years ago

After version 5.6 of the facebook adapter, smart banner adverts no longer work. It looks like an isue with the getAdSize method in the adapter.

Note: this issue is still present in the 6.0 version of the adapter...

10-06 14:43:42.650 I/FacebookAdapter(14428): Potential ad sizes: [360x50_as, 360x90_as, 360x250_as]
10-06 14:43:42.650 E/art     (14428): invalid stream - problem with parameter iterator in /data/data/com.google.android.gms/app_chimera/m/0000009b/dl-AdsFdrDynamite.integ_22060000006.apk for method void qp.a(android.os.Message)
10-06 14:43:42.650 E/art     (14428): invalid stream - problem with parameter iterator in /data/data/com.google.android.gms/app_chimera/m/0000009b/dl-AdsFdrDynamite.integ_22060000006.apk for method void qp.dispatchMessage(android.os.Message)
10-06 14:43:42.650 E/art     (14428): invalid stream - problem with parameter iterator in /data/data/com.google.android.gms/app_chimera/m/0000009b/dl-AdsFdrDynamite.integ_22060000006.apk for method void qp.a(android.os.Message)
10-06 14:43:42.650 E/art     (14428): invalid stream - problem with parameter iterator in /data/data/com.google.android.gms/app_chimera/m/0000009b/dl-AdsFdrDynamite.integ_22060000006.apk for method void qp.dispatchMessage(android.os.Message)
10-06 14:43:42.650 E/art     (14428): invalid stream - problem with parameter iterator in /data/data/com.google.android.gms/app_chimera/m/0000009b/dl-AdsFdrDynamite.integ_22060000006.apk for method void qp.a(android.os.Message)
10-06 14:43:42.650 E/art     (14428): invalid stream - problem with parameter iterator in /data/data/com.google.android.gms/app_chimera/m/0000009b/dl-AdsFdrDynamite.integ_22060000006.apk for method void qp.dispatchMessage(android.os.Message)
10-06 14:43:42.650 E/Ads     (14428): 
10-06 14:43:42.650 E/Ads     (14428): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/MediationUtils;
10-06 14:43:42.650 E/Ads     (14428):   at com.google.ads.mediation.facebook.FacebookAdapter.getAdSize(FacebookAdapter.java:763)
10-06 14:43:42.650 E/Ads     (14428):   at com.google.ads.mediation.facebook.FacebookAdapter.requestBannerAd(FacebookAdapter.java:176)
10-06 14:43:42.650 E/Ads     (14428):   at com.google.android.gms.internal.ads.zzanm.zza(Unknown Source)
10-06 14:43:42.650 E/Ads     (14428):   at com.google.android.gms.internal.ads.zzamu.dispatchTransaction(Unknown Source)
10-06 14:43:42.650 E/Ads     (14428):   at com.google.android.gms.internal.ads.zzfn.onTransact(Unknown Source)
10-06 14:43:42.650 E/Ads     (14428):   at android.os.Binder.transact(Binder.java:380)
10-06 14:43:42.650 E/Ads     (14428):   at ge.b(:com.google.android.gms.policy_ads_fdr_dynamite@22060003@22060003.318333930.318333930:2)
10-06 14:43:42.650 E/Ads     (14428):   at com.google.android.gms.ads.internal.mediation.client.e.a(:com.google.android.gms.policy_ads_fdr_dynamite@22060003@22060003.318333930.318333930:9)
10-06 14:43:42.650 E/Ads     (14428):   at com.google.android.gms.ads.nonagon.render.ae.a(:com.google.android.gms.policy_ads_fdr_dynamite@22060003@22060003.318333930.318333930:15)
10-06 14:43:42.650 E/Ads     (14428):   at com.google.android.gms.ads.nonagon.render.dn.a(Unknown Source)
10-06 14:43:42.650 E/Ads     (14428):   at com.google.android.gms.ads.nonagon.util.concurrent.s.call(Unknown Source)
10-06 14:43:42.650 E/Ads     (14428):   at abw.a(:com.google.android.gms.policy_ads_fdr_dynamite@22060003@22060003.318333930.318333930:1)
10-06 14:43:42.650 E/Ads     (14428):   at abh.run(:com.google.android.gms.policy_ads_fdr_dynamite@22060003@22060003.318333930.318333930:3)
10-06 14:43:42.650 E/Ads     (14428):   at abx.run(:com.google.android.gms.policy_ads_fdr_dynamite@22060003@22060003.318333930.318333930:0)
10-06 14:43:42.650 E/Ads     (14428):   at android.os.Handler.handleCallback(Handler.java:739)
10-06 14:43:42.650 E/Ads     (14428):   at android.os.Handler.dispatchMessage(Handler.java:95)
10-06 14:43:42.650 E/Ads     (14428):   at qp.a(:com.google.android.gms.policy_ads_fdr_dynamite@22060003@22060003.318333930.318333930)
10-06 14:43:42.650 E/Ads     (14428):   at com.google.android.gms.ads.internal.util.f.a(:com.google.android.gms.policy_ads_fdr_dynamite@22060003@22060003.318333930.318333930:1)
10-06 14:43:42.650 E/Ads     (14428):   at qp.dispatchMessage(:com.google.android.gms.policy_ads_fdr_dynamite@22060003@22060003.318333930.318333930)
10-06 14:43:42.650 E/Ads     (14428):   at android.os.Looper.loop(Looper.java:145)
10-06 14:43:42.650 E/Ads     (14428):   at android.app.ActivityThread.main(ActivityThread.java:6934)
10-06 14:43:42.650 E/Ads     (14428):   at java.lang.reflect.Method.invoke(Native Method)
10-06 14:43:42.650 E/Ads     (14428):   at java.lang.reflect.Method.invoke(Method.java:372)
10-06 14:43:42.650 E/Ads     (14428):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
10-06 14:43:42.650 E/Ads     (14428):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
10-06 14:43:42.650 E/Ads     (14428): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.MediationUtils" on path: DexPathList[[zip file "/data/app/com.DevExtras.VoiceTools-1/base.apk"],nativeLibraryDirectories=[/data/app/com.DevExtras.VoiceTools-1/lib/arm, /vendor/lib, /system/lib]]
10-06 14:43:42.650 E/Ads     (14428):   at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
10-06 14:43:42.650 E/Ads     (14428):   at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
10-06 14:43:42.650 E/Ads     (14428):   at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
10-06 14:43:42.650 E/Ads     (14428):   ... 25 more
10-06 14:43:42.650 E/Ads     (14428):   Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.ads.MediationUtils
10-06 14:43:42.650 E/Ads     (14428):       at java.lang.Class.classForName(Native Method)
10-06 14:43:42.650 E/Ads     (14428):       at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
10-06 14:43:42.650 E/Ads     (14428):       at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
10-06 14:43:42.650 E/Ads     (14428):       at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
10-06 14:43:42.650 E/Ads     (14428):       ... 26 more
ericleich commented 4 years ago

@DeliriumCode what Google Mobile Ads SDK version are you building against? MediationUtils was added in play-services-ad:19.2.0. In fact, the MediationUtils call wasn't added until version 5.9.0.2 of the Facebook adapter. The statement that you are experiencing issues since 5.6 leads me to believe think that you are running an old Google Mobile ads SDK that isn't compatible with Facebook adapter 5.6.0.0 or higher.

Adapters do use methods from newer Google Mobile Ads SDKs as they roll out. The CHANGELOG mentions the version of the Google Mobile Ads SDK used to build the adapter, and we don't recommend using a version older than what it was built against.