0

I am trying just to delete a plugin from my cordova project. It should be simple but I don't know why its having an error.

cordova plugin list

shows me this:

cordova-plugin-customurlscheme 4.0.0 "Custom URL scheme"

cordova-plugin-dialogs 1.1.1 "Notification"

cordova-plugin-file 3.0.1-dev "File"

cordova-plugin-file-transfer 1.2.2-dev "File Transfer"

and when I run

cordova plugin rm cordova-plugin-customurlscheme

it shows me :

SyntaxError: Unexpected token /
at Object.parse (native)
at Function.PlatformJson.load (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/PlatformJson.js:35:21)
at runUninstallPlatform (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/uninstall.js:233:37)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/uninstall.js:94:16
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)

What this could be ?

vbotio
  • 1,566
  • 3
  • 26
  • 53
  • check this http://stackoverflow.com/questions/20631138/error-adding-or-deleting-plugins-in-cordova-phone-gap – Max Oct 06 '15 at 14:53
  • I have had strange issues with plugins before. You could try to remove all the plugins by deleting the plugin directory. Then just add them back in. – Filipe Teixeira Oct 06 '15 at 15:38

1 Answers1

1

This can happen when the plugin itself was not coded properly. Try delete the following:

\plugins\cordova-plugin-customurlscheme (or whatever the folder name)

reference to it in \plugins\fetch.json and \plugins\android.json (or ios)

\www\plugins\cordova-plugin-customurlscheme

(the reference in this file) \www\plugins\cordova_plugins.js

If that doesn't work. Just recreate the whole app and add the other plugins back in, and then add the source code back in.

Brett Gregson
  • 5,867
  • 3
  • 42
  • 60
Martin
  • 122
  • 4