cmackay / google-analytics-plugin

Cordova Google Analytics Plugin for Android & iOS
Apache License 2.0
89 stars 43 forks source link

copying google-play-services jar conflicts with other plugins #34

Closed RangerRick closed 9 years ago

RangerRick commented 9 years ago

I use a couple of other plugins that also use google-play-services. If I attempt to test out your google analytics plugin while using the others, it ends up failing like this:

Installing "cc.fovea.cordova.purchase" for android
Installing "com.cmackay.plugins.googleanalytics" for android
Installing "com.google.cordova.admob" for android
Installing "com.rjfun.cordova.extension" for android
Installing "com.google.playservices" for android
Error during processing of action! Attempting to revert...
Failed to install 'com.google.playservices':Error: Uh oh!
"/Users/ranger/git/opennms-mobile/platforms/android/libs/google-play-services.jar" already exists!
    at Object.module.exports.common.copyNewFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:67:19)
    at module.exports.source-file.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:78:20)
    at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:67:25)
    at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:575:20)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:335: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)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
Failed to install 'com.google.cordova.admob':Error: Uh oh!
"/Users/ranger/git/opennms-mobile/platforms/android/libs/google-play-services.jar" already exists!
    at Object.module.exports.common.copyNewFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:67:19)
    at module.exports.source-file.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:78:20)
    at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:67:25)
    at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:575:20)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:335: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)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
Error: Uh oh!
"/Users/ranger/git/opennms-mobile/platforms/android/libs/google-play-services.jar" already exists!
    at Object.module.exports.common.copyNewFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:67:19)
    at module.exports.source-file.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:78:20)
    at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:67:25)
    at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:575:20)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:335: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)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)

This pull request changes your plugin.xml so it has a dependency on "com.google.playservices" rather than hand-copying the jar and version.xml itself. The upstream com.google.playservices version is identical to yours, so it should be equivalent.

cmackay commented 9 years ago

Hi @RangerRick,

Thanks for the pull request. I am testing it out now and I should hopefully have it merged soon.

-Craig

cmackay commented 9 years ago

Hi @RangerRick,

I just wanted to let you know that I published an updated version of the plugin to the cordova repository with the change you submitted. Thanks for your pull request!

-Craig