Ionic package build with phonegap-plugin-push SENDER_ID missing


I know, there are lots of post about phonegap-plugin-push problems with SENDER_ID missing problem.
I followed the guide that indicate how to solve this problem so I installed the pluging like this:

cordova plugin add phonegap-plugin-push --variable SENDER_ID="MY_GOOGLE_PROJ_NUMBER"

and even with

ionic plugin add phonegap-plugin-push --variable SENDER_ID="MY_GOOGLE_PROJ_NUMBER"

Now my local builds works with both options, but the problem of missing SENDER_ID is still there when I try to build from ionic service:

ionic package build android

then I got this error

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

here my package.json

  "cordovaPlugins": [
      "variables": {
      "locator": "phonegap-plugin-push"
      "locator": "",
      "id": "cordova-plugin-x-socialsharing"

and my settings.xml

<plugin name="phonegap-plugin-push" spec="1.7.4">
    <variable name="SENDER_ID" value="MY_GOOGLE_PROJ_NUMBER"/>

Anyone solved this problem With Ionic Platform Service?


Does this not interest anyone, or nobody has got this problem, please give me some hints


Remove the last line of your package.json. The proper section is this:

“locator”: “phonegap-plugin-push”,
“variables”: {

At the end you have this:


Which is redundant and running the install (a second time) fails because SENDER_ID is not specified


Did you ever get a resolution on this? I have exactly the same issue. I can build fine locally using ‘ionic build ios’ but if I use ‘ionic package build ios --release --profile distribution’ I get the same error you do.

            "variables": {
                "SENDER_ID": "xxxxxx"
            "locator": "phonegap-plugin-push"

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


Yes I’ve solved the problem, but unfortunately without understanding what was wrong.
I fact I created from scratch project, I created a new project, copied all my files and then I have installed all the plugins by following their instructions.
and it worked