# FCM and Google plus compile issue

**URL:** <https://forum.ionicframework.com/t/fcm-and-google-plus-compile-issue/131932>\
**Category:** ionic-v1\
**Created:** [June 1, 2018, 12:03pm UTC](https://forum.ionicframework.com/t/fcm-and-google-plus-compile-issue/131932 "2018-06-01T12:03:45Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![ghosteye](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@ghosteye](https://forum.ionicframework.com/u/ghosteye)\
**Post date:** [June 6, 2018, 2:26am UTC](https://forum.ionicframework.com/t/fcm-and-google-plus-compile-issue/131932/8 "2018-06-06T02:26:46Z")

</div>

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------------------------\>

```auto
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

```auto
<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

```auto
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

```

---

_[View the full topic](https://forum.ionicframework.com/t/fcm-and-google-plus-compile-issue/131932)._
