1

I run into several nasty errors when attemping to remove the phonegap-plugin-push from my VS2015 Cordova project, and of course the app is now in a completely screwed state (unable to build, run, etc).

In Cordova CLI, we simply removed the platform and deleted the plugins dir, and re-added the platform to fix this problem, but I can't find any reference on how to do this with Visual Studio 2015. Deleting the plugins folder would probably cause my project to suddenly implode.

Any ideas on how to (manually?) erase all plugins from my project will be welcome, thanks.

andreszs
  • 2,896
  • 3
  • 26
  • 34

2 Answers2

1

Deleting the plugins directory... Hacky and overkill at best, risky at worst: once you add a plugin using the Cordova CLI, there will be traces of it in Cordova's config files, then it won't find them, everything will go haywire...

To remove all the plugins, just use the Cordova CLI. To list all the plugins, go:

cordova plugins

Then, for each plugin remove it as such:

cordova plugins rm org.myname.mypluginname

There is no way to remove all the plugins in one line, so unless you write a script, you're going to have to remove them one by one.

I suppose you knew all this already, but I wouldn't try any other way, be it from Visual Studio or anything else. What you did (removing all the plugins and the platforms, then adding them again) is the way I usually do it when things go sour on a specific platform.

I would just advise using the Cordova CLI to remove stuff (platforms or plugins), rather than deleting directories and then tinkering with Cordova's configuration files.

Chris Neve
  • 2,164
  • 2
  • 20
  • 33
1

Old thread, but I keep landing here so here's my 2 cents.

I know the frustration that leads to wanting to nuke the plugins directory. And Chris Neve is right it's a hacky solution, but simply removing plugins with the CLI just doesn't always remove the plugin. ESPECIALLY if the removal trips on a missing variable or other error. In those cases, what worked for me was:

Remove the platform

cordova plugin remove plugin-name

Remove any plugin reference from /plugins/fetch.json

Remove any plugin reference from package.json

Remove the directory and contents of the individual plugin directory from /plugins

Install any replacement plugins

Add the platform

brianfit
  • 1,829
  • 1
  • 19
  • 34