fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
623 stars 998 forks source link

Issue with cordova FCM plugin #412

Open ReactMaverick opened 6 years ago

ReactMaverick commented 6 years ago

I have installed cordova FCM plugin using command " ionic plugin add cordova-plugin-fcm " and getting the following error while building the project.

untitled

luigi37 commented 6 years ago

Hi. I had the same issue and seems a conflict with other plugins (in my case mauron85 background location). I tried a lot but was not able to make the two work together...

CarlosBC commented 6 years ago

Have you tried? ionic cordova platform remove android ionic cordova platform add android

swindex commented 6 years ago

I found this plugin not playing nicely with FCM: https://github.com/EddyVerbruggen/cordova-plugin-googleplus

usama-ayub commented 6 years ago

Step 1 (for FCM Plugin)

Comment out these lines in the FCMPlugin.gradle file.

classpath 'com.google.gms:google-services:3.0.0' apply plugin: com.google.gms.googleservices.GoogleServicesPlugin

Step 2 (for FCM Plugin)

Change the plugin.xml of the FCM plugin.

framework src="com.google.firebase:firebase-core:9.8.0" framework src="com.google.firebase:firebase-messaging:9.8.0"

Step 3 (for Cordova-googlemap)

framework src="com.google.android.gms:play-services-maps:9.0.0" framework src="com.google.android.gms:play-services-location:9.0.0"

Step 4

Remove and re-add plattform.

Step 5 (build.gradle file of the android platform folder)

Add this line to the classpath section classpath 'com.google.gms:google-services:3.1.0'

dependencies { compile fileTree(dir: 'libs', include: '*.jar') // SUB-PROJECT DEPENDENCIES START debugCompile(project(path: "CordovaLib", configuration: "debug")) releaseCompile(project(path: "CordovaLib", configuration: "release")) compile "com.google.android.gms:play-services-maps:9.8.0" compile "com.google.android.gms:play-services-location:9.8.0" compile "com.google.firebase:firebase-core:9.8.0" compile "com.google.firebase:firebase-messaging:9.8.0" // SUB-PROJECT DEPENDENCIES END } And add this line below the dependencies, nearly at the bottom of the file apply plugin: 'com.google.gms.google-services'

i found this solution and also thanks @troovers

swindex commented 6 years ago

@usama-ayub,

Thanks! Your solution worked for cordova-plugin-googleplus with the exertion of step 3 where: cordova-plugin-googleplus\plugin.xml framework src="com.google.android.gms:play-services-auth:9.8.0 framework src="com.google.android.gms:play-services-identity:9.8.0

usama-ayub commented 6 years ago

welcome it's my pleasure @swindex

luigi37 commented 6 years ago

Hi all. Still having issues with this. Anything simpler and more maintainable?

laxusgooee commented 6 years ago

@usama-ayub problem is the other plugin requires 11.1.4 but FCM still uses 9.0.0. My app crashes when i do step 3

tahseenquraishi commented 5 years ago

I have used this plugin "cordova-plugin-fcm-with-dependecy-updated" instead of "cordova-plugin-fcm" and its work fine