简体   繁体   中英

cannot install cordova plugin

i am trying to add plugin

cordova plugin add https://github.com/RootDev-EG/PushNotification.git
to my application but getting the following error with stack trace from cli :

 <pre> /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/state.js:543 throw 'Error executing "' + pluginCommand + '":\\n' + output; ^ Error executing "cordova plugin add https://github.com/RootDev-EG/PushNotification.git ": Fetching plugin "https://github.com/RootDev-EG/PushNotification.git" via git clone Repository "https://github.com/RootDev-EG/PushNotification.git" checked out to git ref "master". Installing "com.phonegap.plugins.PushPlugin" for android Notice: org.apache.cordova.device has been automatically converted to cordova-plugin-device and fetched from npm. This is due to our old plugins registry shutting down. Dependent plugin "cordova-plugin-device" already installed on android. Notice: org.apache.cordova.globalization has been automatically converted to cordova-plugin-globalization and fetched from npm. This is due to our old plugins registry shutting down. Fetching plugin "cordova-plugin-globalization" via npm Installing "cordova-plugin-globalization" for android Notice: com.google.playservices has been automatically converted to cordova-plugin-googleplayservices and fetched from npm. This is due to our old plugins registry shutting down. Fetching plugin "https://github.com/MobileChromeApps/google-play-services.git" via git clone Repository "https://github.com/MobileChromeApps/google-play-services.git" checked out to git ref "master". Failed to install 'com.phonegap.plugins.PushPlugin':Error: Expected plugin to have ID "cordova-plugin-googleplayservices" but got "com.google.playservices". at checkID (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:181:15) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:166:9 at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/node_modules/q/q.js:796:13) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/node_modules/q/q.js:604:44 at runSingle (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/node_modules/q/q.js:137:13) at flush (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/node_modules/q/q.js:125:13) at doNTCallback0 (node.js:419:9) at process._tickCallback (node.js:348:13) Error: Expected plugin to have ID "cordova-plugin-googleplayservices" but got "com.google.playservices". </pre> 

thanks in advance for any help

The answer is in the README of this plugin https://github.com/MobileChromeApps/google-play-services which is a dependency of the one your trying to use.

You could find other people looking for some workarounds in this thread: https://github.com/Telerik-Verified-Plugins/PushNotification/issues/64

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM