Mopub ads not showing(Mopub 广告未展示)
问题描述
我被一个问题困住了一段时间,我不知道它是什么.问题是我最近更新了 Mopub Android SDK,在此之前,插页式 + 横幅广告(AdMob 和 Millennial 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
.如果您不希望它完全摆脱" Mopub
、AdMob
和 MMedia
代码,只需将以下行放入 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 广告未展示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Mopub 广告未展示


基础教程推荐
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01