fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
624 stars 989 forks source link

cordova-plugin-fcm and cordova-plugin-googleplus not compatiable #231

Open grendo opened 7 years ago

grendo commented 7 years ago

Hi, I have an issue when I try and use cordova-plugin-fcm and cordova-plugin-googleplus in the one project. When they are both in the same project you get the error during the android build

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

Taking one of the plugins out of the project and the android build works again.

I have tried setting the play-services-auth and play-services-identity to specific versions like 9.4.0, 9.2.0, 9.0.0 in the plugin xml files and the android project.properties but you get the same error, eg

Found com.google.android.gms:play-services-identity:9.2.0, but version 9.0.0 is needed for the google-services plugin.

Environment Cordova CLI: 6.4.0 Ionic Framework Version: 2.0.0-rc.5 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.0.0 ios-deploy version: Not installed ios-sim version: Not installed OS: Windows 8.1 Node Version: v6.9.2 Xcode version: Not installed Android 6.0

Any idea how to resolve this ?

glaudsonsilva commented 7 years ago

I'm facing the same issue. Have you figured this out?

JackThomson2 commented 7 years ago

Hi guys, I was having the same issue as you however I managed to fix it doing the following process:

Under 'platforms/android' open the file 'project.properties'. Here edit the lines so they look similar to mine :

cordova.system.library.1=com.android.support:appcompat-v7:23.4.0 cordova.system.library.2=com.facebook.android:facebook-android-sdk:4.14.+ cordova.system.library.3=com.google.firebase:firebase-core:9.0.0 cordova.system.library.4=com.google.firebase:firebase-messaging:9.0.0 cordova.system.library.5=com.google.android.gms:play-services-auth:9.0.0 cordova.system.library.6=com.google.android.gms:play-services-identity:9.0.0

Once you have edited this go too 'plugins/cordova-plugin-fcm' and open the file 'plugin.xml' in there edit the tags so they look like this now:

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

Finally go too 'plugins/cordova-plugin-googleplus' and open the file plugin.xml' in there edit the tags so they look now like this:

<framework src="com.google.android.gms:play-services-auth:9.0.0" /> <framework src="com.google.android.gms:play-services-identity:9.0.0" />

Then after that I ran a ionic prepare and the app ran successfully. If this doesn't fix it let me know and I'll check if I did some other changes (spent a while fixing this)

Thanks Jack

demonVibe commented 7 years ago

@JackThomson2 I did exactly like you said this did fix the build issue, but now the app crashes. Please let me know if you did any other changes.

JackThomson2 commented 7 years ago

What is the error you get on the crash?

ishaq-bhojani commented 7 years ago

Hi there, I'm facing the same Issue @JackThomson2 I too did the same as you suggested but same results as @demonVibe said, I got this error on my Logs, java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.<init>()' is inaccessible to class 'com.google.android.gms.iid.zzd' (declaration of 'com.google.android.gms.iid.zzd' appears in /data/app/com.example.packagename-1/base.apk)

I also tried to goole about this error and found this link http://stackoverflow.com/questions/40218025/gcm-unregister-causing-the-application-to-crash

and tried what they said in expected answer but it says.

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

Any help will be appreciated, Thanks

Lazar955 commented 7 years ago

Same problem,tried all solutions from here and from opened issue on cordova-plugin-googleplus repo. Nothing works so far...

yoprogramo commented 7 years ago

Same here... Do you know some option to google auth that works with fcm?

Lazar955 commented 7 years ago

@yoprogramo I have switched to cordova-plugin-firebase, and it works fine with googleplus plugin. Check it out.

Naminator69 commented 6 years ago

praise the lord

Naminator69 commented 6 years ago

@JackThomson2 you fucking beauty this is the only solution of 10000 that ive tried that fixed the problem for me. THANK YOU

WisaniShilumani commented 6 years ago

I'm still having this issue. Using @JackThomson2 's solution; app builds fine now, but crashes on open

ishaq-bhojani commented 6 years ago

Use this plugin. It's the working fine on both iOS and Android.

cheonbrave commented 6 years ago

A solution that can be used cordova-plugin-fcm, cordova-plugin-googleplus

http://cheonbrave.blogspot.kr/2017/09/ionic-android-studio-error.html