Cordova - Install AdMob Plugin on Android Failed (Mac)

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:

Cordova 3.5
Android api 19
Java 8
Eclipse Luna
Apache Ant 1.9.4
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 “com.google.playservices@19.0.0” via plugin registry Failed to install ‘com.google.admobsdk’:Error: Expected fetched plugin to have ID “com.google.playservices@19.0.0” 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 “com.google.playservices@19.0.0” 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 “com.google.playservices@19.0.0” 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

Please upgrade your cordova to v4.0, then it will recognize the dependency version correctly.

BTW, you should try the pro version:

It’s much better than the basic version.

1 Like