I am facing thi error in installing AdMob cordova plugin on android https://github.com/floatinghotpot/cordova-plugin-admob ,, The plugin is installed and works fine with iOS platform, but it gives this error on android.
My Enviroment:
npm 1.4.16
Command:
cordova plugin add https://github.com/floatinghotpot/cordova-plugin-admob.git
Fetching plugin "https://github.com/floatinghotpot/cordova-plugin-admob.git" via git clone Installing "com.rjfun.cordova.plugin.admob" for android Fetching plugin "com.google.admobsdk" via plugin registry Installing "com.google.admobsdk" for android Fetching plugin "[email protected]" via plugin registry Failed to install 'com.google.admobsdk':Error: Expected fetched plugin to have ID "[email protected]" but got "com.google.playservices". at checkID (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:116:19) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:99:24 at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13) at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44 at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17) at process._tickCallback (node.js:419:13) Failed to install 'com.rjfun.cordova.plugin.admob':Error: Expected fetched plugin to have ID "[email protected]" but got "com.google.playservices". at checkID (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:116:19) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:99:24 at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13) at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44 at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17) at process._tickCallback (node.js:419:13) Error: Expected fetched plugin to have ID "[email protected]" but got "com.google.playservices". at checkID (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:116:19) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:99:24 at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13) at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44 at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17) at process._tickCallback (node.js:419:13)
Any ideas?! Thanks in advance
You need upgrade to cordova CLI v4.0, just run:
sudo npm install cordova -g
The root cause of this failure is, cordova CLI v3.5 does not correctly recognize the following dependency in plugin com.google.admobsdk
.
<dependency id="[email protected]"/>
You may ask, why @19.0.0
is added?
It's used to specify an exact version, and keep it compatible with cordova CLI and Intel XDK.
As the default com.google.playservices
(@21.0.0) cannot be handled by Intel XDK (at least so far, when this answer is being posted), while version [email protected]
can be correctly handled by Intel XDK.
Some bugs in cordova v3.5 causes this problem and has been fixed in cordova v4.0, mentioned as "Pinned dependencies" in the release notes.
See release notes: http://cordova.apache.org/announcements/2014/10/16/cordova-4.html
So, please upgrade to cordova CLI v4.0, it will be much easier.
If any issue, please ask in the project issue tracker page, you will be supported timely.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments