cannot uninstall Cordova plugin

2019-04-10 03:51发布

问题:

In my Ionic app, I just uninstalled a Cordova plugin this way :

$ cordova plugin remove phonegap-facebook-plugin

Uninstalling phonegap-facebook-plugin from android

but when I list the plugins it still appears as installed :

$ cordova plugins
cordova-plugin-googleplayservices 19.0.3 "Google Play Services for Android"
cordova-plugin-googleplus 4.0.3 "Google+"
cordova-plugin-whitelist 1.1.1-dev "Whitelist"
ionic-plugin-keyboard 1.0.7 "Keyboard"
phonegap-facebook-plugin 0.12.0 "Facebook Connect"

Can help me figure this out ?

Thanks

回答1:

Please delete phonegap-facebook-plugin from your plugin folder manually.



回答2:

the problem is you have to use the --save flag when you run the cordova plugin rm command. cordova plugin remove phonegap-facebook-plugin --save

This --save flag tells the compiler to also remove it from config.xml , where all the plugins are listed. When you don't pass the --save flag, the plugin entry remains in the config.xml and thus when you run: "cordova plugins ls", your plugin is still there..

This should be highlighted more clearly in the official cordova docs..



回答3:

A). You can directly delete plugin from plugin directory.

  1. got to project/directory/plugin.
  2. Choose plugin you want to delete.
  3. Remove from there.

B). On obuntu or mac

 1. open terminal (ctrl+t).
 2. $ cd project/directory/plugin.
 3. $ rm -rf plugin-name-to-be-remove.

C). Cordova Command

 1. $ cd project/directory/plugin.
 2. $  cordova plugin remove cordova-plugin-name

This may help you..



回答4:

You can directly delete the plugin from plugin folder or use the cordova plugin remove plugin-name You can find the list of plugin by this command cordova plugin list

Sometime this make a great issue that the plugin part also remains in the platform folder. So you can remove the platform and add the platform again.



回答5:

You can remove any cordova plugin forcefully by using below command,

cordova plugin remove phonegap-facebook-plugin--force

then try to remove all platforms using below command,

cordova platform remove <platform_name>

then try to add platforms again using below command,

cordova platform add <platform_name>

Finally prepare project using below command,

cordova prepare