Version of installed plugin: "cocoon-plugin-ads-android-admob@2.0.0" does not satisfy dependency plugin requirement "cocoon-plugin-ads-android-admob@^1.0.12". Try --force to use installed plugin as dependency


#1

COMPILER ERROR:

Version of installed plugin: “cocoon-plugin-ads-android-admob@2.0.0” does not satisfy dependency plugin requirement “cocoon-plugin-ads-android-admob@^1.0.12”. Try --force to use installed plugin as dependency.

CORDOVA LOG:

e[36m20181201T142459 [DEBUG] AndroidBuilder -e[39m [prepare] cordova restore platforms
e[36m20181201T142459 [DEBUG] AndroidBuilder -e[39m [prepare] adding engine android@6.2.3
Subproject Path: CordovaLib
Subproject Path: CordovaLib
Subproject Path: CordovaLib
(node:22963) [DEP0016] DeprecationWarning: ‘root’ is deprecated, use ‘global’
e[36m20181201T142530 [DEBUG] AndroidBuilder -e[39m [prepare] cordova restore plugins
e[36m20181201T142530 [DEBUG] AndroidBuilder -e[39m [prepare] adding plugin @fcarreno/cordova-plugin-nativeaudio@*
e[36m20181201T142530 [DEBUG] AndroidBuilder -e[39m [prepare] adding plugin @stevegill/cordova-plugin-device@*
e[36m20181201T142530 [DEBUG] AndroidBuilder -e[39m [prepare] adding plugin cocoon-plugin-ads-android-admob@2.0.0
e[36m20181201T142530 [DEBUG] AndroidBuilder -e[39m [prepare] adding plugin cocoon-plugin-ads-android-admob-applovin@1.0.2
e[91m20181201T142530 [ERROR] AndroidBuilder -e[39m { CordovaError: Version of installed plugin: “cocoon-plugin-ads-android-admob@2.0.0” does not satisfy dependency plugin requirement “cocoon-plugin-ads-android-admob@^1.0.12”. Try --force to use installed plugin as dependency.
at /opt/cocoon_compiler/workspace/production/data/libs/cordova-lib@7.0.0/node_modules/cordova-lib/src/plugman/install.js:581:33
at _fulfilled (/opt/cocoon_compiler/workspace/production/data/libs/cordova-lib@7.0.0/node_modules/q/q.js:787:54)
at /opt/cocoon_compiler/workspace/production/data/libs/cordova-lib@7.0.0/node_modules/q/q.js:816:30
at Promise.promise.promiseDispatch (/opt/cocoon_compiler/workspace/production/data/libs/cordova-lib@7.0.0/node_modules/q/q.js:749:13)
at /opt/cocoon_compiler/workspace/production/data/libs/cordova-lib@7.0.0/node_modules/q/q.js:509:49
at flush (/opt/cocoon_compiler/workspace/production/data/libs/cordova-lib@7.0.0/node_modules/q/q.js:108:17)
at process._tickCallback (internal/process/next_tick.js:61:11)
name: ‘CordovaError’,
message:
‘Version of installed plugin: “cocoon-plugin-ads-android-admob@2.0.0” does not satisfy dependency plugin requirement “cocoon-plugin-ads-android-admob@^1.0.12”. Try --force to use installed plugin as dependency.’,
code: 0,
context: undefined }
e[91m20181201T142530 [ERROR] AndroidBuilder -e[39m BuilderError {
message:
‘Version of installed plugin: “cocoon-plugin-ads-android-admob@2.0.0” does not satisfy dependency plugin requirement “cocoon-plugin-ads-android-admob@^1.0.12”. Try --force to use installed plugin as dependency.’,
msgPublic:
‘Version of installed plugin: “cocoon-plugin-ads-android-admob@2.0.0” does not satisfy dependency plugin requirement “cocoon-plugin-ads-android-admob@^1.0.12”. Try --force to use installed plugin as dependency.’ }


#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.