google-analytics-plugin: Install fails with "Path must be a string. Received undefined"

➜  phonegap git:(master) ✗ cordova plugin add https://github.com/danwilson/google-analytics-plugin.git
Fetching plugin "https://github.com/danwilson/google-analytics-plugin.git" via git clone
Repository "https://github.com/danwilson/google-analytics-plugin.git" checked out to git ref "master".
Installing "cordova-plugin-google-analytics" for android
Error during processing of action! Attempting to revert...
Failed to install 'cordova-plugin-google-analytics':TypeError: Uh oh!
Path must be a string. Received undefined
    at assertPath (path.js:8:11)
    at Object.posix.resolve (path.js:424:5)
    at Object.module.exports.framework.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:139:35)
    at installWrapper (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:77:32)
    at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:68:25)
    at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:576:20)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:363:28
    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)

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 1
  • Comments: 18 (1 by maintainers)

Most upvoted comments

It could be a permissions issue as it was for me. Try removing the platform and then adding it back, which will reset the permissions.

sudo ionic state reset sudo ionic plugin remove cordova-plugin-googlemaps

This issue is related to the cordova installation, please check that you have the last cordova installed in you machine.

[vns@localhost ~]$ cordova -v 6.2.0

any solution on this ?