Error: Can not add any plugin


#1

Good afternoon.
When I try to add a plugin like ‘phonegap-plugin-push’ , I get the following error message:
‘Error: Variable(s) missing (use: --variable SENDER_ID=value)’

This started to happen after I updated the Cordova to the latest version
is there something i can do ? or should i rollback the Cordova ?


#2

What command are you entering to add a plugin? And could you share which versions of ionic/cordova you’re using?


#3

sorry forgot to type the command
it is "cordova plugin add PLUGIN_NAME"
but is working now , i removed the android platform and added back


#4

I am facing the same problem now, I used the following command to add plugin. Any idea?

cordova plugin add https://github.com/phonegap/phonegap-plugin-push


#5

Did you follow the installation instructions over here? Because you have to add some variables with that plugin as well… If it doesn’t work well for you, you can use the ngCordova wrappers with the pushPlugin, documented here.


#6

This plugin requires a variable to installation , this variable is the authentication token from GCM

Example:
phonegap plugin add phonegap-plugin-push --variable SENDER_ID=“XXXXXXX”


#7

Thank you so much guys, its working now. I used the below command

phonegap plugin add phonegap-plugin-push --variable SENDER_ID=“XXXXXXX”

Thanks :slight_smile: