2

FAILURE: Build failed with an exception.

TechValens
  • 437
  • 6
  • 20

1 Answers1

4

Easy solution is to install this updated plugin from my github account: Remove fcm plugin:

ionic cordova plugin remove cordova-plugin-fcm-with-dependecy-updated

And install this updated version:

ionic cordova plugin add https://github.com/ishan123456789/cordova-plugin-fcm-with-dependecy-updated.git

If the above doesn't workout for you. The hard way

A solution for the above problem as seen in some channels is to: Go to the plugins/cordova-plugin-fcm or plugins/cordova-plugin-fcm-with-dependency-updated then go to src/android/FCMPlugin.gradle

And replace:

    classpath 'com.google.gms:google-services:3.1.+'

With

    classpath 'com.google.gms:google-services:4.1.0'

And core to:

    dependencies {
        compile 'com.google.firebase:firebase-core:11.8.0'
    }

And plugin.xml

    <framework src="com.google.firebase:firebase-core:11.8.0" />
    <framework src="com.google.firebase:firebase-messaging:11.8.0" />

The replace took place as per the google service higher version. In my case the conflict was with google plus plugin so I went to plugins/cordova-plugin-googleplus and there the google service version was

    <preference name="PLAY_SERVICES_VERSION" default="11.8.0"/>
    <framework src="com.google.android.gms:play-services-auth:$PLAY_SERVICES_VERSION" />
    <framework src="com.google.android.gms:play-services-identity:$PLAY_SERVICES_VERSION" />

So from here the version 11.8.0 came.

https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/283

https://github.com/fechanique/cordova-plugin-fcm/issues/231

Google Play Services GCM 10.0.1 asks to “update” back to 9.0.0

https://github.com/fechanique/cordova-plugin-fcm/issues/499

https://github.com/fechanique/cordova-plugin-fcm/issues/306

This answer was quite resourceful

com.google.android.gms:play-services-measurement-base is being requested by various other libraries

Black Mamba
  • 13,632
  • 6
  • 82
  • 105