Mopub 广告未显示 [英] Mopub ads not showing

查看:26
本文介绍了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 广告未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆