Mopub 广告未展示

Mopub ads not showing(Mopub 广告未展示)
本文介绍了Mopub 广告未展示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被一个问题困住了一段时间,我不知道它是什么.问题是我最近更新了 Mopub Android SDK,在此之前,插页式 + 横幅广告(AdMobMillennial Media)都运行良好.现在这些广告在发布版本中不起作用,但它们在调试版本中起作用.所以我认为这是 proguard 的问题,但我无法追踪它是什么.proguard 是根据 Mopub 指南设置的.

I've been stuck on an issue for a while and I can't figure out what it is. The thing is I recently updated the Mopub Android SDK and both interstitial + banner ads (AdMob and Millennial Media) were working fine before that. Now these ads aren't working in the release build but they do work in debug build. So I think this is an issue with proguard but I can't trace what it is. The proguard is setup according to Mopub guidelines.

我在 proguard 中为我的项目添加了以下内容:

I have added the following to proguard for my project:

-keep class com.google.ads.**
-keep class com.millennialmedia.android.**
-keep public class com.mopub.mobileads.*
-keepclassmembers class com.millennialmedia.android.* {
public *;
}

在发布版本中,当我尝试展示广告时,我得到以下日志:

In the release build, when I try to display an ad I get the following logs :

I/MoPub   (29856): Fetching ad network type: admob_native
D/MoPub   (29856): Loading custom event interstitial adapter.
D/MoPub   (29856): Attempting to invoke custom event: com.mopub.mobileads.GoogleAdMobInterstitial
D/MoPub   (29856): Couldn't locate or instantiate custom event: com.mopub.mobileads.GoogleAdMobInterstitial.

I/MoPub   (29856): Fetching ad network type: admob_native
D/MoPub   (29856): Loading custom event adapter.
D/MoPub   (29856): Attempting to invoke custom event: com.mopub.mobileads.GoogleAdMobBanner
D/MoPub   (29856): Couldn't locate or instantiate custom event: com.mopub.mobileads.GoogleAdMobBanner.
V/MoPub   (29856): MoPubErrorCode: Unable to find Native Network or Custom Event adapter.

请提出错误可能是什么.任何反馈将不胜感激.

Please suggest what the error might be. Any feedback would be appreciated.

我也不知道这是否相关,但我正在开发一个 Cocos2dx Android 项目.

Also I don't know if this is relevant or not but I'm working on a Cocos2dx Android project.

谢谢.

推荐答案

确实是ProGuard.如果您不希望它完全摆脱" MopubAdMobMMedia 代码,只需将以下行放入 proguard-project.txt 项目文件:

It is ProGuard indeed. If you don't want it to "get rid" of Mopub, AdMob and MMedia code entirely, just put the following lines into proguard-project.txt file of your project:

    -keep class com.google.ads.** {*;}
    -keep class com.mopub.mobileads.** {*;}
    -keep class com.millennialmedia.android.** {*;}
    -keep class com.millennialmedia.google.** {*;}

这篇关于Mopub 广告未展示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)