samzilverberg/cordova-mixpanel-plugin

APK build crashes with "Execution failed for task ':processReleaseGoogleServices'."

Closed this issue · 1 comments

It appears that this plugin is failing to coexist with the phonegap-plugin-push plugin. As described here:

https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/INSTALLATION.md#co-existing-with-plugins-that-use-firebase

Specifically:

Those plugins should be using gradle to include the Google Play Services package but instead they include the play services jar directly or via a plugin dependency. So all of that is bad news. These plugins should be updated to use gradle. Please raise issues on those plugins as the change is not hard to make.

And here is the trace from the build:

%% Command finished with error code 1: /home/mad/git/apkTest/.meteor/local/cordova-build/platforms/android/gradlew cdvBuildRelease,-b,/home/mad/git/apkTest/.meteor/local/cordova-build/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true
=> Errors executing Cordova commands:         
                                              
   While building Cordova app for platform Android:
   Error: /home/mad/git/apkTest/.meteor/local/cordova-build/platforms/android/gradlew: Command failed with exit code 1 Error output:
   FAILURE: Build failed with an exception.
   
   * What went wrong:
   Execution failed for task ':processReleaseGoogleServices'.
   > Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available
   at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.6.2.
   
   * Try:
   Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
   
   * Get more help at https://help.gradle.org
   
   BUILD FAILED in 39s
   at ChildProcess.whenDone
   (/home/mad/git/apkTest/.meteor/local/cordova-build/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
   at emitTwo (events.js:126:13)
   at ChildProcess.emit (events.js:214:7)
   at maybeClose (internal/child_process.js:925:16)
   at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

this mixpanel plugin doesn't depend on any specific version of google play services.
it was impl this way exactly to avoid conflicts with other plugins.
if there are still somehow probs from the version this plugin has then you can set a specific version for it via preference PLAY_SERVICES_VERSION.
see code at:

<!--
Minimum required version of Google Play Services SDK for this plugin is + (as per current version).
You can optionally specify a version number to align the version with other plugins that utilize gcm.
https://developers.google.com/android/guides/releases
-->
<preference name="PLAY_SERVICES_VERSION" default="+" />
<framework src="com.google.android.gms:play-services-base:$PLAY_SERVICES_VERSION"/>
<framework src="com.google.android.gms:play-services-gcm:$PLAY_SERVICES_VERSION"/>