Ismael Chuliá
Ismael Chuliá

Reputation: 77

I can't install cordova plugins

I'm trying to add this plugin https://github.com/MobileAppTracking/phonegap-plugin but when I run the command I see this error:

 Error during processing of action! Attempting to revert...
Failed to install 'com.mobileapptracking.matplugin':TypeError: Uh oh!
Arguments to path.resolve must be strings
    at Object.exports.resolve (path.js:313:15)
    at module.exports.framework.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:106:31)
    at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:70:25)
    at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:567:20)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:322:20
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
TypeError: Uh oh!
Arguments to path.resolve must be strings
    at Object.exports.resolve (path.js:313:15)
    at module.exports.framework.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:106:31)
    at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:70:25)
    at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:567:20)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:322:20
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)

My node version is v0.10.25
My npm version is 1.3.10
My cordova version is 3.6.3-0.2.13

Upvotes: 1

Views: 4855

Answers (2)

Santosh Shinde
Santosh Shinde

Reputation: 6063

You should update your Cordova version and update your android platform or remove it totally and then add it once again.

Please Update Cordova :

sudo npm update -g cordova

please remove your android platform by using following command

cordova platform rm android

And then add platform using following command

cordova platform add android

Hopes this will help you !

Upvotes: 0

Niko
Niko

Reputation: 3422

You should update your Cordova version and cordova-android, remove the plugin and clean its installed dependencies, to have then a new clean install of the plugin

  1. Update Cordova :

    sudo npm update -g cordova
    
  2. Update android Platform

    cordova platform update android
    
  3. In your case, it seems that you should remove the plugin

    cordova plugin remove com.mobileapptracking.matplugin
    
  4. Remove manually Play Services dependency in your directories and in android.json file

  5. Then reinstall the plugin

    cordova plugin add https://github.com/MobileAppTracking/phonegap-plugin
    

Upvotes: 9

Related Questions