Mopub ads not showing

I’ve been stuck in a problem for some time, and I can’t understand what it is. The fact is, I recently updated the Mopub Android SDK, and both interstitial + banner ads (AdMob and Millennial Media) worked fine before that. Now these ads do not work in release builds, but they work in debug builds. Therefore, I think this is a problem with proguard , but I can not track what it is. proguard configured as recommended by Mopub.

I 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 indicate what might be a mistake. Any feedback would be appreciated.

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

Thanks.

+6
source share
2 answers

This is truly ProGuard . If you don’t want to completely “get rid” of the Mopub , AdMob and MMedia , simply put the following lines in the 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.** {*;} 
+8
source

You need to create your own private network and add your own class to the mopub website. The same goes for the millennium and make sure you add the necessary adapters to your project.

-1
source

Source: https://habr.com/ru/post/953055/


All Articles