Trouble with CustomEvent mediation

533 views
Skip to first unread message

Joachim Stokke

unread,
Oct 5, 2015, 7:45:06 AM10/5/15
to Google Mobile Ads SDK Developers
Hi guys, 

I am having trouble getting mediation to work with Amazon ads. Since it doesn't have an adapter in the AdMob mediation list, I have to write a CustomEvent for it. 
I've followed the instructions, and gone over them multiple times to make sure I didn't miss anything, but I can't get it to work.

Logcat is giving the message: Could not instantiate custom event adapter: com.mypackage.AmazonCustomEventBanner
The code in my custom event class is never called (requestBannerAd)

I don't know how to debug it further. Is there a way for me to know why the custom event can not be instantiated? 

Hope someone can help me out!


-Joachim


Joachim Stokke

unread,
Oct 5, 2015, 8:03:59 AM10/5/15
to Google Mobile Ads SDK Developers
I forgot to mention some things:

using play-services-ads 8.1.0
My CustomEventBanner is implementing com.google.android.gms.ads.mediation.customevent.CustomEventBanner

Vu Chau (MobileAds SDK Team)

unread,
Oct 5, 2015, 4:33:00 PM10/5/15
to Google Mobile Ads SDK Developers
Hi Joachim.

One of the reasons your custom event adapter isn't getting called is because the package and class names defined on AdMob's interface don't match with those in your code.  Could you confirm if this is the case?

Thanks,

Vu Chau
Mobile Ads SDK Team

Joachim Stokke

unread,
Oct 5, 2015, 5:10:59 PM10/5/15
to Google Mobile Ads SDK Developers
Hi!

The package and class names are identical. I've even copy pasted to make sure that is not the issue.

Vu Chau (MobileAds SDK Team)

unread,
Oct 6, 2015, 9:40:30 AM10/6/15
to Google Mobile Ads SDK Developers
Hi Joachim,

Thanks for confirming with us that that wasn't the case.  Now, the only reason I can think of is, somehow your custom event class might still be in the project, but it is not in the final build (the .apk).  That would explain why the adapter isn't called.  You can use Apktool to decompile your apk, and verify if your class can be found.

Let us know what you find,

Vu Chau
Mobile Ads SDK Team

Joachim Stokke

unread,
Oct 6, 2015, 2:50:55 PM10/6/15
to Google Mobile Ads SDK Developers
Hi again!

You were right! The problem was proguard was removing what it thought was an unused class. After I made it keep the class in the apk, things were working great! :)

Thanks a lot for your help!

-Joachim
Reply all
Reply to author
Forward
0 new messages