FCM and Google plus compile issue

Finally got work. Thank you very much for the guide wf9a5m75 I followed folowing steps to resolve issue. If someone need follow this step and correct me if I’m wrong.
My environment
cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

Cordova Platforms : android 6.4.0
Ionic Framework   : ionic1 1.3.1

System:

Android SDK Tools : 26.1.1
Node              : v8.9.1
npm               : 6.1.0
OS                : Linux 4.13

1)After adding both google and fcm plugin remove android platform using
$ cordova plugin add cordova-plugin-googleplus
$ cordova plugin add cordova-plugin-fcm
$ ionic cordova platform remove android
2)Then edit ProjectName/plugins/cordova-plugin-fcm/src/android/FCMPlugin.gradle
as follows

<--------------------------FCMPlugin.gradle------------------------>

buildscript {
	repositories {
            jcenter()
			mavenLocal()
        }
    dependencies {
        classpath 'com.android.tools.build:gradle:+'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}
// apply plugin: 'com.google.gms.google-services'
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
//apply plugin: com.google.gms.googleservices.GoogleServicesPlugin


ext.postBuildExtras = {
    apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
}

<--------------------------FCMPlugin.gradle------------------------/>

3)Then edit ProjectName/plugins/cordova-plugin-fcm/plugin.xml as follows

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

4)Afterwords add platform again
$ ionic cordova platform add android@~6.4.0
5)Then build the project. This could failed again. If it is goto
ProjectName/platforms/android/project.properties
and edit as follows

target=android-26
	android.library.reference.1=CordovaLib
	cordova.gradle.include.1=cordova-android-play-services-gradle-release/buzzflownewdesign-cordova-android-play-services-gradle-release.gradle
	cordova.system.library.1=com.google.firebase:firebase-core:11.8.0
	cordova.system.library.2=com.google.firebase:firebase-messaging:11.8.0
	cordova.gradle.include.2=cordova-plugin-fcm/buzzflownewdesign-FCMPlugin.gradle
	cordova.system.library.3=com.google.android.gms:play-services-auth:11.8.0
	cordova.system.library.4=com.google.android.gms:play-services-identity:11.8.0
1 Like