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


#1

Compile error 04-12-2018.zip (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:
    3.0.0-beta

  • Webview engine(s):
    Webview+

  • Used plugins (if relevant):
    cocoon-plugin-social-android-googleplaygames
    cordova-plugin-whitelist
    cocoon-plugin-ads-android-admob

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


#2

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.


#3

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

https://forums.cocoon.io/t/unable-to-use-cocoon-admob-plugin-ads-not-showing/8878/7


#4

I will try it, thanks for the tip.


#5

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?