Remove plugin from ionic

Hello All,
I have added below plugin in my project, now I want to remove it. how should I do it.

cordova plugin add https://github.com/floatinghotpot/cordova-plugin-paypalmpl.git

Regrs,
Suhas

2 Likes

cordova plugin remove name-of-plugin

You can view name of plugin inside plugin folder in your project

15 Likes

I prefer using ionic plugin add | rm over cordova plugin add, to anticipate future additions over cordova plugin’s functionality. I think at the moment they are equivalent though.

I’ve added gulp tasks for easy installation & uninstallation

gulpfile.js - extract

var cordovaPlugins = [
  'org.apache.cordova.device',
  'org.apache.cordova.console',
  'org.apache.cordova.splashscreen',
  'com.ionic.keyboard',
];
// can define this in some config file
/*
var config = require('ionic.config');
var .cordovaPlugins = config.cordovaPlugins
*/

gulp.task('installCordovaPlugins', function() {
  var d = Q.defer();
  // execute ionic plugin add for each of the plugins
  var addPromises = cordovaPlugins.map(function(plugin) {
    return exec('ionic plugin add '+plugin);
  });
  // wait for all shell actions to complete
  Q.all(addPromises).then(function() {
    d.resolve();
  });
  return d.promise;
});

gulp.task('uninstallCordovaPlugins', function() {
  var d = Q.defer();
  // fetch list of all installed plugins
  var installedPlugins = require('./plugins/android.json').installed_plugins;
  // execute ionic plugin rm for each installed plugin
  var rmPromises = [];
  for(var plugin in installedPlugins) {
    rmPromises.push(exec('ionic plugin rm '+plugin));
  };
  // wait for all shell actions to complete
  Q.all(rmPromises).then(function() {
    d.resolve();
  });
  return d.promise;
});
2 Likes

Thank you all. :). I was able to remove plugin.

Regards,
Suhas

like this for example with the fileopener2 plugin

cordova plugin remove io.github.pwlin.cordova.plugins.fileopener2

Hi Bennit,

On the line I quoted below, I see a reference to “android.json”.

I cannot help but ask – how about ios?

ionic plugin list

This should give you a list of plugins

cordova-plugin-whitelist 1.1.1-dev "Whitelist" ionic-plugin-keyboard 1.0.7 "Keyboard" org.apache.cordova.device 0.3.0 "Device" org.apache.cordova.dialogs 0.3.0 "Notification" org.apache.cordova.globalization 0.3.4 "Globalization" org.apache.cordova.inappbrowser 0.6.0 "InAppBrowser"

Now, let’s say I want to remove the Globalization Plugin

ionic plugin rm org.apache.cordova.globalization

I would make sure to write the %packagename%

Thanks

3 Likes