Ionic build error for android platform


#1

Hello guys,

Recently i needed to integrate Google analytics and Push notification plugin into my ionic app. But whenever i try to add these plugin i get error on adding them like below:

Updated the hooks directory to have execute permissions
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!
Arguments to path.resolve must be strings
    at Object.exports.resolve (path.js:313:15)
    at Object.module.exports.framework.install (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:139:35)
    at installWrapper (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:77:32)
    at Object.ActionStack.process (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:68:25)
    at handleInstall (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:550:20)
    at /home/hitenpratap/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:342:28
    at _fulfilled (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /home/hitenpratap/npm/lib/node_modules/cordova/node_modules/q/q.js:509:49
TypeError: Uh oh!
Arguments to path.resolve must be strings
    at Object.exports.resolve (path.js:313:15)
    at Object.module.exports.framework.install (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:139:35)
    at installWrapper (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:77:32)
    at Object.ActionStack.process (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:68:25)
    at handleInstall (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:550:20)
    at /home/hitenpratap/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:342:28
    at _fulfilled (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/home/hitenpratap/npm/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /home/hitenpratap/npm/lib/node_modules/cordova/node_modules/q/q.js:509:49

Please guys any help would be very appreciated and i’m stuck at this problem since last 2-3 days. And i really needed ti get it done ASAP.


#2

What does ‘$ ionic info’ return?

How did you ‘add’ the plugins?

$ ionic plugin add org.apache.cordova.geolocation

Did you install the ngCordova project using Bower?

$ bower install --save ngCordova


#3

Ionic info return:

Your system information:

Cordova CLI: 5.1.1
Ionic CLI Version: 1.4.5
Ionic App Lib Version: 0.0.22
OS: Distributor ID:    Ubuntu Description:    Ubuntu 14.10 
Node Version: v0.10.25

And i didn’t install ngCordova using bower instead i just downloaded the zip package from its Github repo and added the ngCordova.min.js into index.html file and mention ngCordova as dependency in app.js file.

And i’m installing plugins like cordova plugin add "plugin-name"

Ansd i think ngCordova is fine as toast and vibrate plugin is working absolutely fine. The error is with only Google analytics and Push notification plugin only.

Thanks