我最近开始在 Unity 中研究 Admob 中介。使用 Admob 指南,我已经成功完成了一些广告网络,但现在偶然发现由于某种原因无法正常工作的 Audience Network,我检查了以下 Logcat:
04-25 12:27:41.444: I/Ads(24246): Trying mediation network: https://googleads.g.doubleclick.net/aclk?sa=L&ai=CktAubWHBXJCyJsLKxgK8iJa4D_nJ2qYF0e-FupIBABAIIPaf5WNgy9y0BakCAAAAAICELkGoAwGqBCpP0JYVqjXRsTejJKRPkKjp4qtE5jVAPiRaFF77IXqeLsWUzY__-Pd2elqQBgHABguAB4H4qTCYBwGoB9nLG6gHz8wb0ggHCIABEAEYDg&num=1&cid=CAASBORoPe4&sig=AOD64_1JupFPNn7lFJJqOokofvlT0lFnhw&adurl=http://example.com
04-25 12:27:41.445: I/Ads(24246): Instantiating mediation adapter: com.google.ads.mediation.facebook.FacebookAdapter
04-25 12:27:41.447: I/zygote(24246): Rejecting re-init on previously-failed class java.lang.Class<com.google.ads.mediation.facebook.FacebookMediationAdapter>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/mediation/Adapter;
04-25 12:27:41.447: I/zygote(24246): at java.lang.Class java.lang.Class.classForName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:-2)
04-25 12:27:41.447: I/zygote(24246): at java.lang.Class java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:453)
04-25 12:27:41.447: I/zygote(24246): at com.google.android.gms.internal.zzkb com.google.android.gms.internal.zzjz.zzau(java.lang.String) ((null):-1)
04-25 12:27:41.447: I/zygote(24246): at com.google.android.gms.internal.zzkb com.google.android.gms.internal.zzjz.zzas(java.lang.String) ((null):-1)
04-25 12:27:41.447: I/zygote(24246): at boolean com.google.android.gms.internal.zzka$zza.onTransact(int, android.os.Parcel, android.os.Parcel, int) ((null):-1)
04-25 12:27:41.447: I/zygote(24246): at boolean android.os.Binder.transact(int, android.os.Parcel, android.os.Parcel, int) (Binder.java:622)
04-25 12:27:41.447: I/zygote(24246): at android.os.Parcel ox.a(int, android.os.Parcel) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:2)
04-25 12:27:41.447: I/zygote(24246): at com.google.android.gms.ads.internal.mediation.client.e com.google.android.gms.ads.internal.mediation.client.d.a(java.lang.String) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:1)
04-25 12:27:41.447: I/zygote(24246): at void com.google.android.gms.ads.internal.mediation.g.run() (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:6)
04-25 12:27:41.447: I/zygote(24246): at void android.os.Handler.handleCallback(android.os.Message) (Handler.java:789)
04-25 12:27:41.447: I/zygote(24246): at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:98)
04-25 12:27:41.447: I/zygote(24246): at void aai.a(android.os.Message) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:-1)
04-25 12:27:41.447: I/zygote(24246): at void com.google.android.gms.ads.internal.util.e.a(android.os.Message) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:1)
04-25 12:27:41.447: I/zygote(24246): at void aai.dispatchMessage(android.os.Message) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:-1)
04-25 12:27:41.448: I/zygote(24246): at void android.os.Looper.loop() (Looper.java:164)
04-25 12:27:41.448: I/zygote(24246): at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6798)
04-25 12:27:41.448: I/zygote(24246): at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
04-25 12:27:41.448: I/zygote(24246): at void com.android.internal.os.Zygote$MethodAndArgsCaller.run() (Zygote.java:240)
04-25 12:27:41.448: I/zygote(24246): at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:767)
04-25 12:27:41.448: I/zygote(24246): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.mediation.Adapter" on path: DexPathList[[zip file "/data/app/com.test.admob.mediation.to-ol90HvQyH2v8rU4_iVV7qA==/base.apk"],nativeLibraryDirectories=[/data/app/com.test.admob.mediation.to-ol90HvQyH2v8rU4_iVV7qA==/lib/arm, /data/app/com.test.admob.mediation.to-ol90HvQyH2v8rU4_iVV7qA==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
04-25 12:27:41.448: I/zygote(24246): at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:93)
04-25 12:27:41.448: I/zygote(24246): at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
04-25 12:27:41.448: I/zygote(24246): at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
04-25 12:27:41.448: I/zygote(24246): at java.lang.Class java.lang.Class.classForName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:-2)
04-25 12:27:41.448: I/zygote(24246): at java.lang.Class java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:453)
04-25 12:27:41.448: I/zygote(24246): at com.google.android.gms.internal.zzkb com.google.android.gms.internal.zzjz.zzau(java.lang.String) ((null):-1)
04-25 12:27:41.448: I/zygote(24246): at com.google.android.gms.internal.zzkb com.google.android.gms.internal.zzjz.zzas(java.lang.String) ((null):-1)
04-25 12:27:41.448: I/zygote(24246): at boolean com.google.android.gms.internal.zzka$zza.onTransact(int, android.os.Parcel, android.os.Parcel, int) ((null):-1)
04-25 12:27:41.448: I/zygote(24246): at boolean android.os.Binder.transact(int, android.os.Parcel, android.os.Parcel, int) (Binder.java:622)
04-25 12:27:41.448: I/zygote(24246): at android.os.Parcel ox.a(int, android.os.Parcel) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:2)
04-25 12:27:41.448: I/zygote(24246): at com.google.android.gms.ads.internal.mediation.client.e com.google.android.gms.ads.internal.mediation.client.d.a(java.lang.String) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:1)
04-25 12:27:41.448: I/zygote(24246): at void com.google.android.gms.ads.internal.mediation.g.run() (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:6)
04-25 12:27:41.448: I/zygote(24246): at void android.os.Handler.handleCallback(android.os.Message) (Handler.java:789)
04-25 12:27:41.448: I/zygote(24246): at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:98)
04-25 12:27:41.448: I/zygote(24246): at void aai.a(android.os.Message) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:-1)
04-25 12:27:41.448: I/zygote(24246): at void com.google.android.gms.ads.internal.util.e.a(android.os.Message) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:1)
04-25 12:27:41.448: I/zygote(24246): at void aai.dispatchMessage(android.os.Message) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:-1)
04-25 12:27:41.448: I/zygote(24246): at void android.os.Looper.loop() (Looper.java:164)
04-25 12:27:41.448: I/zygote(24246): at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6798)
04-25 12:27:41.448: I/zygote(24246): at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
04-25 12:27:41.448: I/zygote(24246): at void com.android.internal.os.Zygote$MethodAndArgsCaller.run() (Zygote.java:240)
04-25 12:27:41.448: I/zygote(24246): at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:767)
04-25 12:27:41.449: I/zygote(24246): Rejecting re-init on previously-failed class java.lang.Class<com.google.ads.mediation.facebook.FacebookAdapter>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/ads/mediation/facebook/FacebookMediationAdapter;
04-25 12:27:41.449: I/zygote(24246): at java.lang.Class java.lang.Class.classForName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:-2)
04-25 12:27:41.449: I/zygote(24246): at java.lang.Class java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:453)
04-25 12:27:41.449: I/zygote(24246): at com.google.android.gms.internal.zzkb com.google.android.gms.internal.zzjz.zzau(java.lang.String) ((null):-1)
04-25 12:27:41.449: I/zygote(24246): at com.google.android.gms.internal.zzkb com.google.android.gms.internal.zzjz.zzas(java.lang.String) ((null):-1)
04-25 12:27:41.449: I/zygote(24246): at boolean com.google.android.gms.internal.zzka$zza.onTransact(int, android.os.Parcel, android.os.Parcel, int) ((null):-1)
04-25 12:27:41.449: I/zygote(24246): at boolean android.os.Binder.transact(int, android.os.Parcel, android.os.Parcel, int) (Binder.java:622)
04-25 12:27:41.449: I/zygote(24246): at android.os.Parcel ox.a(int, android.os.Parcel) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:2)
04-25 12:27:41.449: I/zygote(24246): at com.google.android.gms.ads.internal.mediation.client.e com.google.android.gms.ads.internal.mediation.client.d.a(java.lang.String) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:1)
04-25 12:27:41.449: I/zygote(24246): at void com.google.android.gms.ads.internal.mediation.g.run() (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:6)
04-25 12:27:41.449: I/zygote(24246): at void android.os.Handler.handleCallback(android.os.Message) (Handler.java:789)
04-25 12:27:41.449: I/zygote(24246): at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:98)
04-25 12:27:41.449: I/zygote(24246): at void aai.a(android.os.Message) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:-1)
04-25 12:27:41.449: I/zygote(24246): at void com.google.android.gms.ads.internal.util.e.a(android.os.Message) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:1)
04-25 12:27:41.449: I/zygote(24246): at void aai.dispatchMessage(android.os.Message) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:-1)
04-25 12:27:41.449: I/zygote(24246): at void android.os.Looper.loop() (Looper.java:164)
04-25 12:27:41.449: I/zygote(24246): at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6798)
04-25 12:27:41.449: I/zygote(24246): at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
04-25 12:27:41.449: I/zygote(24246): at void com.android.internal.os.Zygote$MethodAndArgsCaller.run() (Zygote.java:240)
04-25 12:27:41.449: I/zygote(24246): at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:767)
04-25 12:27:41.449: I/zygote(24246): Caused by: java.lang.ClassNotFoundException: com.google.ads.mediation.facebook.FacebookMediationAdapter
04-25 12:27:41.449: I/zygote(24246): at java.lang.Class java.lang.VMClassLoader.findLoadedClass(java.lang.ClassLoader, java.lang.String) (VMClassLoader.java:-2)
04-25 12:27:41.449: I/zygote(24246): at java.lang.Class java.lang.ClassLoader.findLoadedClass(java.lang.String) (ClassLoader.java:738)
04-25 12:27:41.449: I/zygote(24246): at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:363)
04-25 12:27:41.449: I/zygote(24246): at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
04-25 12:27:41.449: I/zygote(24246): at java.lang.Class java.lang.Class.classForName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:-2)
04-25 12:27:41.449: I/zygote(24246): at java.lang.Class java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:453)
04-25 12:27:41.449: I/zygote(24246): at com.google.android.gms.internal.zzkb com.google.android.gms.internal.zzjz.zzau(java.lang.String) ((null):-1)
04-25 12:27:41.449: I/zygote(24246): at com.google.android.gms.internal.zzkb com.google.android.gms.internal.zzjz.zzas(java.lang.String) ((null):-1)
04-25 12:27:41.449: I/zygote(24246): at boolean com.google.android.gms.internal.zzka$zza.onTransact(int, android.os.Parcel, android.os.Parcel, int) ((null):-1)
04-25 12:27:41.449: I/zygote(24246): at boolean android.os.Binder.transact(int, android.os.Parcel, android.os.Parcel, int) (Binder.java:622)
04-25 12:27:41.449: I/zygote(24246): at android.os.Parcel ox.a(int, android.os.Parcel) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:2)
04-25 12:27:41.449: I/zygote(24246): at com.google.android.gms.ads.internal.mediation.client.e com.google.android.gms.ads.internal.mediation.client.d.a(java.lang.String) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:1)
04-25 12:27:41.449: I/zygote(24246): at void com.google.android.gms.ads.internal.mediation.g.run() (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:6)
04-25 12:27:41.449: I/zygote(24246): at void android.os.Handler.handleCallback(android.os.Message) (Handler.java:789)
04-25 12:27:41.449: I/zygote(24246): at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:98)
04-25 12:27:41.449: I/zygote(24246): at void aai.a(android.os.Message) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:-1)
04-25 12:27:41.449: I/zygote(24246): at void com.google.android.gms.ads.internal.util.e.a(android.os.Message) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:1)
04-25 12:27:41.449: I/zygote(24246): at void aai.dispatchMessage(android.os.Message) (:com.google.android.gms.policy_ads_fdr_dynamite@30000@30000.238272502.238272502:-1)
04-25 12:27:41.449: I/zygote(24246): at void android.os.Looper.loop() (Looper.java:164)
04-25 12:27:41.449: I/zygote(24246): at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6798)
04-25 12:27:41.449: I/zygote(24246): at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
04-25 12:27:41.449: I/zygote(24246): at void com.android.internal.os.Zygote$MethodAndArgsCaller.run() (Zygote.java:240)
04-25 12:27:41.449: I/zygote(24246): at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:767)
04-25 12:27:41.450: I/Ads(24246): Trying mediation network: https://googleads.g.doubleclick.net/aclk?sa=L&ai=Cl_QQbWHBXJCyJsLKxgK8iJa4D_nJ2qYF0e-FupIBABAIIPaf5WNgy9y0BakCAAAAAICELkGoAwGqBCpP0JYVqjXRsTejJKRPkKjp4qtE5jVAPiQVMm_0IRvtMMWUkrPG0sY8WVmQBgHABguAB4H4qTCYBwGoB9nLG6gHz8wb0ggHCIABEAEYDg&num=1&cid=CAASBORoPe4&sig=AOD64_2uPRs5nS_rhuIF-J_uAnHVfY4hYg&adurl=http://example.com
04-25 12:27:41.450: I/Ads(24246): Instantiating mediation adapter: com.google.ads.mediation.chartboost.ChartboostAdapter
正如您所看到的,当调用开始为受众网络适配器实例化时,一些 zygote 事物开始抛出这些奇怪的日志,并抛出 ClassNotFoundException 它没有找到 google gms 中介适配器类。此外,它忽略了这一点并继续前进,然后它显示了 FacebookMediationAdapter 的另一个 ClassNotFOundException。奇怪的是,LogCat 中的所有这些日志都是绿色的,不是红色的错误,也不是黄色的警告,而是绿色的日志。但我忽略了这一点,开始明白为什么会这样。我使用 JD-GUI 打开了观众网络适配器 aar 文件,并在那里找到了相关的 FacebookMediationAdapter 类。
然后我打开播放服务和广告库 aar 文件,它也有相关的 gms 中介类。这些类中引用的更多功能也存在于这些类中。
我想到的问题是为什么当我能清楚地看到它们时,统一没有找到它们。其次,这些文件甚至与包 apk 一起使用吗?