Anders Lindén Anders Lindén - 1 month ago 16
Android Question

cordova plugin rm cordova-plugin-whitelist does not change config.xml so it will be readded upon build

When I run

cordova plugin rm cordova-plugin-whitelist


and then run

cordova build android


I get the following message:


Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project

Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for android

This plugin is only applicable for versions of cordova-android greater
than 4.0. If you have a previous platform version, you do not need
this plugin since the whitelist will be built in.


and then the build proceeds.

So cordova plugin rm is not removing the plugin as I never installed it, as it should?

edit



Removing this plugin will make the webview blank. I expected it to accept any url, but it rejected everything.

eb1 eb1
Answer

I'm not sure what your question is here. In order to remove the plugin from the config.xml file, you'll need to add the --save flag to the cordova plugin rm call (reference):

cordova plugin rm <plugin-id> --save

Without the --save flag, the plugin is removed from the app, but not from the config.xml file.

So when you next call cordova build or cordova prepare, the script will look at your config.xml file and add any plugins that are specified there but not installed. So the plugin will be added back.