Error after add cocoon-plugin-ads-android-admob

Compile error (2.2 KB)
After add cocoon-plugin-ads-android-admob I got a compile error. If I remove it compile fine.
I tried Multidex and got another error.
This same project used to work with this plugin in the past, the error started to happen after I changed the cocoon version to 3.0.0-beta.

Full log attached.

  • Cocoon Version:

  • Webview engine(s):

  • Used plugins (if relevant):

  • Framework/game engine (if relevant):
    Pure javascript

The AdMob plugins had been having problems lately, but I have a solution that can work on the latest Cocoon version, but it involves using a different AdMob plugin within your Config.xml: <plugin name=“admob” spec="*"/>.

Then, add the following within the “deviceready” event:

admob.initAdmob(bannerAdUnitVar, interstitialAdUnitVar);

//show in ad receive event fun need add receive listener:
document.addEventListener(admob.Event.onInterstitialReceive, onInterstitialReceive, false);
document.addEventListener(admob.Event.onAdmobBannerDismiss, onAdmobEvent, false);
document.addEventListener(admob.Event.onAdmobBannerFailedReceive, onAdmobEvent, false);
document.addEventListener(admob.Event.onAdmobBannerLeaveApplication, onAdmobEvent, false);
document.addEventListener(admob.Event.onAdmobBannerPresent, onAdmobEvent, false);
document.addEventListener(admob.Event.onAdmobBannerReceive, onAdmobEvent, false);
document.addEventListener(admob.Event.onAdmobInterstitialDismiss, function(){
	//You can add any function here.
}, false);
document.addEventListener(admob.Event.onAdmobInterstitialFailedReceive, function(){
	//You can add any function here.
}, false);
document.addEventListener(admob.Event.onAdmobInterstitialLeaveApplication, onAdmobEvent, false);
document.addEventListener(admob.Event.onAdmobInterstitialPresent, function(){
	//You can add any function here.
}, false);
document.addEventListener(admob.Event.onAdmobInterstitialReceive, onAdmobEvent, false);

Now, to preload your ads, call “admob.cacheInterstitial();” for Interstitial Ads, then “admob.showInterstitial();” to launch it.

Hope this helps, while we hope Ludei and even CranBerry will ever fix their own AdMob plugins.

Just experienced this too… Did you try any of the suggestions on this thread?

I will try it, thanks for the tip.

No, the guy says that admob ads are not showing, but for me is worst, it not compiles.

You had the same problem? How did you solve this?

i see the github ads plugin is still on gradle 17.0.0


this need to update to
for cocoon ads to work…
this is just my 2 cents…
hope this info help the admin

I changed the plugin to admob, and changed the code. Now I’m able to compile, but any calls to plugin got no effect neither raise any error. Do I miss something?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.