Ionic package - Error: Variable(s) missing (use: --variable SENDER_ID=value)


#1

Im trying to start using ionic package but i always get error sender_ID i missing:

ionic package build ios --profile myprofile

Your app has been successfully submitted to Ionic Package!

Then build fails

output:

Fetching plugin “phonegap-plugin-push” via npm
Error: Variable(s) missing (use: --variable SENDER_ID=value).

In my package.json i got

“cordovaPlugins”: [
“cordova-plugin-splashscreen”,
“cordova-plugin-statusbar”,
“ionic-plugin-keyboard”,
“cordova-plugin-inappbrowser”,
“cordova-plugin-geolocation”,
“cordova-plugin-camera”,
“cordova-plugin-file”,
“cordova-plugin-file-transfer”,
“cordova-plugin-dialogs”,
“cordova-plugin-device”,
“cordova-plugin-console”,
“cordova-plugin-network-information”,
{
“variables”: {
“SENDER_ID”: “5850XXX”
},
“locator”: “phonegap-plugin-push”
}
],

I also specified my SENDER ID in config.xml

 <plugin name="phonegap-plugin-push" spec="*">
  <variable name="SENDER_ID" value="58506XXX"/>
 </plugin>

But nothing works - any ideas how to fix this?

Plugin - https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/INSTALLATION.md


#2

If you want to support android then you need to create a google develop account, create a new project for your app and set SENDER_ID=“your-project-number-from-google-developer-console”. Checkout the phonegap-plugin-push docs for more info https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/INSTALLATION.md


#3

I already got an account but does Package process check that you got a valid SENDER_ID?


#4

Hello,

Have you tried to delete the plugin and add it again ?

ionic plugin rm phonegap-plugin-push --save
ionic plugin add phonegap-plugin-push --variable SENDER_ID=“XXXXXXX” --save


#5

This was for sometime ago - i switched to regular builds for the moment havent checked for a while. But i would love to use “Package” in future…


#6

If you’re using Ionic package I would try setting the SEND_ID in your config.xml.

Note: You need to specify the SENDER_ID variable in your config.xml if you plan on installing/restoring plugins using the prepare method. The prepare method will skip installing the plugin otherwise.



#7

I have the same issue, I can build in xcode fine, but if I use ionic package, I always get
Error: Variable(s) missing (use: --variable SENDER_ID=value).

Despite having is set in the config.

<plugin name="phonegap-plugin-push" spec="~1.8.3">
    <variable name="SENDER_ID" value="868145353627"/>
  </plugin>

#8

You can also set the sender id via the command -

ionic config set gcm_key “Sender key here”


#9

Hello.

Got the same error.

output:
Error: Variable(s) missing (use: --variable SENDER_ID=value).

I was reinstall plugin with variable, check config.xml and package.json
Any suggestions ?