Somehow in my app many of the cordova plugins are installed and because of that it requires access to almost everything - from my contacts to current location ( even though
Should be fine!
I do it with this python one-liner:
python -c "import subprocess as sp;[sp.call('cordova plugin rm ' + p.split()[0], shell=True) for p in sp.check_output('cordova plugin', shell=True).split('\n') if p]"
Obviously it doesn't handle any sort of error conditions, but it gets the job done.
If the above solution didn't work and you got any unhandled promise rejection then try to follow steps :
Clean the Cordova project
cordova clean
cordova platform remove android/ios
cordova plugin remove
This is somewhat related and might help others, I had a corrupt version of some of my plugins so I was able to just delete the entire contents of the plugins folder. Note, all references are still in the package.json and config.xml files to the plugins. So then when I removed and added the Android platform, it re-installed the uncorrupted versions of the plugins and fixed my problem.
v2.0.0 of cordova-check-plugins enables you to remove all plugins in a project:
$ npm install -g cordova-check-plugins
$ cordova-check-plugins --remove-all
It will attempt to use the Cordova CLI to remove each plugin, but if this fails it will force removal of the plugin from platforms/
and plugins/
.
If you also want to remove from config.xml, use:
$ cordova-check-plugins --remove-all --save
Disclaimer: I am the author of cordova-check-plugins
When running the command: cordova plugin remove <PLUGIN NAME>
, ensure that you do not add the version number to the plugin name. Just plain plugin name, for example:
cordova plugin remove cordova.plugin_name
and not:
cordova plugin remove cordova.plugin_name 0.01
or
cordova plugin remove "cordova.plugin_name 0.01"
In case there is a privilege issue, run with sudo if you are on a *nix system, for example:
sudo cordova plugin remove cordova.plugin_name
Then you may add --save to remove it from the config.xml file. For example:
cordova plugin remove cordova.plugin_name --save