3

I am trying to add the phonegap-push-plugin as described in the doc.

I found this thread listing the problem but with no solution given.

As explain in the doc, I did a CLI in [My project folder]: ionic plugin add phonegap-plugin-push --variable SENDER_ID="[project id from Google Developper Console]"

At firts I had issue with Cordova and Cordova-android version. I updated Cordova from 6.3.0 to 6.4.0 and then did a CLI: ionic platform rm android to remove the existing version 5.2 Cordova-android project.

After that when I do a ionic info I get:

  • Cordova CLI: 6.4.0
  • Ionic Framework Version: 2.0.0-rc.0
  • Ionic CLI Version: 2.1.0
  • Ionic App Lib Version: 2.1.0-beta.1
  • OS:
  • Node Version: v6.7.0

And if I do a ionic platform ls I get: Available platforms:

  • amazon-fireos ~3.6.3 (deprecated)
  • android ~6.0.0
  • blackberry10 ~3.8.0
  • browser ~4.1.0
  • firefoxos ~3.6.3
  • webos ~3.7.0
  • windows ~4.4.0
  • wp8 ~3.8.2 (deprecated)

Now the only problem left when I launch ionic plugin add phonegap-plugin-push --variable SENDER_ID="[project id from Google Developper Console]" is this message:

Error: Cannot find plugin.xml for plugin "phonegap-plugin-push". Please try adding it again.

Any idea?

nyluje
  • 3,573
  • 7
  • 37
  • 67
  • You might try using a slightly earlier version of the plugin -- maybe the latest version is broken. You can specify version numbers using `@x.y.z` after the plugin name. – Kerri Shotts Nov 10 '16 at 17:04
  • thanks I finaly managed it by using full url instead of plugin name. And it is the last version.) – nyluje Nov 10 '16 at 17:14

3 Answers3

9

I experienced a similar error albeit when trying to add the storage plugin:

Error: Cannot find plugin.xml for plugin "cordova-sqlite-storage". Please try adding it again.

I found out that the plugin folder somehow still existed in myapp/plugins such that I had a myapp/plugins/cordova-sqlite-storage

I deleted myapp/plugins/cordova-sqlite-storage plugin directory and added the plugin afresh and it was successful.

Richie254
  • 494
  • 5
  • 8
5

I've finally managed it by switching plugin name (phonegap-plugin-push) by full URL (https://github.com/phonegap/phonegap-plugin-push):

ionic plugin add https://github.com/phonegap/phonegap-plugin-push --variable SENDER_ID="[project id from Google Developper Console]

instead of:

ionic plugin add phonegap-plugin-push --variable SENDER_ID="[project id from Google Developper Console]

nyluje
  • 3,573
  • 7
  • 37
  • 67
  • 1
    I have faced this issue many times and always use the full url method.Don't know why? – Ali Sadiq Nov 10 '16 at 17:41
  • Thank you so much for the solution. If you get an error "Cannot find plugin.xml for plugin" try to install a plugin like this ionic cordova plugin add phonegap-plugin-push – Manoj Alwis Feb 05 '21 at 00:10
0

If you get an error "Cannot find plugin.xml for plugin" try to install a plugin like this ionic cordova plugin add phonegap-plugin-push

Manoj Alwis
  • 1,337
  • 11
  • 24