Build Failing after installing FCM

I’m trying to get the FCM plugin working, i’ve installed everything according to docs, set up everything on the Firebase side, added my google-service.json, and I try an ionic cordova build android, it runs until I get here:

    :processDebugGoogleServices
    Found com.google.android.gms:play-services-gcm:10.2+, but version 9.0.0
    is needed for the google-services plugin.
    :processDebugGoogleServices FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':processDebugGoogleServices'.
    > 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 9.0.0.

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or
    --debug option to get more log output.

    BUILD FAILED

    Total time: 8.27 secs
    Error: cmd: Command failed with exit code 1 Error output:
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':processDebugGoogleServices'.
    > 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 9.0.0.

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or
    --debug option to get more log output.

I’ve been digging around for hours, reinstalled the android platform, updated all of my SDK tools etc., made various suggested changes to the build.gradle file, but nothing I have done has got rid of this error. Has anyone solved this issue as it relates to FCM?

Two plugins are trying to install different versions of the same dependency, which Cordova can’t handle.

1 Like

Thanks for pointing me in the right direction! I ended up having to uninstall the phonegap-plugin-push, which was a just good guess since it was the only other thing dealing with push notifications, and the build was successful.

1 Like

If you use FCM you don’t need that anyway, I think. So good call, you got off easy :wink: For others it’s a lot more complicated.