EddyVerbruggen / cordova-plugin-googleplus

:heavy_plus_sign: Cordova plugin to login with Google Sign-In on iOS and Android
567 stars 629 forks source link

plugin not working with cordova-plugin-firebase #487

Open Lucasq95 opened 6 years ago

Lucasq95 commented 6 years ago

I've encountered an issue when trying to work with this plugin and cordova-plugin-firebase. I implemented googleplus login in my app and everything worked fine. The problem appeared when i added cordova-plugin-firebase to work with push notifications. After adding firebase plugin when trying to login google's auth modal wasn't displayed and i had no error logged. After some digging i found that in the android project.properties the following libraries where using old versions: com.google.android.gms:play-services-identity:11.0.8 com.google.android.gms:play-services-auth:11.0.8

while all firebase libraries where using + version.

I changed play-services versions to + and everything worked.

I think that an update is needed on this versions in the plugin, cause they are very old compared to the latest release which is v 15.0.0 https://developers.google.com/android/guides/releases

jobehi commented 6 years ago

YES ! Thanks @Lucasq95 ! for those facing the same issue after running cordova, reproduce this : cordova platform rm android cordova platform add android change the libraries version in plateforms/android/project.properties to + cordova run android

leonardomontes commented 6 years ago

@Lucasq95 you are the man!

matjazonline commented 6 years ago

I get still get this after adding the plugin to ionic 3 with firebase:

FAILURE: Build failed with an exception.

BUILD FAILED in 2s 37 actionable tasks: 1 executed, 36 up-to-date (node:24482) UnhandledPromiseRejectionWarning: Error: /Users/allisnow/dev/yexApp/platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

edufruit commented 6 years ago

@Lucasq95 : I am also stuck at the firebase issue, this ain't working with firebase plugin, the login checker hangs without any alert error message, but I am using Phonegap Build, Kindly help me out on your solution to how to execute your solution on Phonegap Build.

edufruit commented 6 years ago

@matjazonline Did anyone found a solution ?

MisaZ10 commented 6 years ago

did you try change project.properties ? cordova.system.library.10=com.google.android.gms:play-services-auth:11.8.0 cordova.system.library.11=com.google.android.gms:play-services-identity:11.8.0

by

cordova.system.library.10=com.google.android.gms:play-services-auth:15.0.0 cordova.system.library.11=com.google.android.gms:play-services-identity:15.0.0

in Android project ?

edufruit commented 6 years ago

ok, i will try this one. also can you let me know how to implement this on phonegap build

zankevich commented 6 years ago

@MisaZ10 Is there possibility to define these versions via ionic/cordova?

hikelvin commented 6 years ago

This worked for me too. I changed it to "+".

If you want to make it so you don't have to manually change the project.properties in the platform/android folder every time you remove and add the platform, you can change the value of the same thing in plugins/cordova-plugin-googleplus/plugin.xml.

<!-- android -->
  <platform name="android">

    <framework src="com.google.android.gms:play-services-auth:+" />
    <framework src="com.google.android.gms:play-services-identity:+" />
BhargavKilambi commented 6 years ago

@matjazonline for your issue go to your project root folder and do this cordova clean And then cordova build This should help you with that Dex Merger issue 🙂

michalakjan commented 6 years ago

if you are using for build ionic pro platform or basically don't want to change this inside project.properties or cordova-plugin then you can use cordova-plugin-platform-replace plugin, all you need to add this plugin to your project

ionic cordova plugin add cordova-plugin-platform-replace

and then add to your config.xml

<platform name="android">
      <replace-string file="project.properties" find="com.google.android.gms:play-services-auth:11.8.0" replace="com.google.android.gms:play-services-auth:+" />
      <replace-string file="project.properties" find="com.google.android.gms:play-services-identity:11.8.0" replace="com.google.android.gms:play-services-identity:+" />
</platform>
andreybleme commented 6 years ago

Thanks @Lucasq95 :100: your described solution worked for me!

brianmak3 commented 6 years ago

Thanks man, this saved my day cordova.system.library.5=com.google.android.gms:play-services-auth:+` cordova.system.library.6=com.google.android.gms:play-services-identity:+

techno2mahi commented 6 years ago

@Lucasq95 Can you please confirm the versions of you both the plugins ie cordova-plugin-firebase. and googleplus> I have also added this plugin . But in my platfor>android.Gradle.properties file the versions are coming like this cordova.system.library.8=com.google.android.gms:play-services-auth:11.8.0 cordova.system.library.9=com.google.android.gms:play-services-identity:11.8.0

I am getting this build error message Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForDebug'.

java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

I have tried by changing them to + but no luck so far. Please help, its killing me.

Lucasq95 commented 6 years ago

@techno2mahi i haven't tried cordova-android-play-services-gradle-release so i dont know if its worth installing another package to manage versions. My advice is to keep it clean, uninstall both libraries and try installing them again and please show me what error the compiler throws.

Just a comment: Every plugin should have its android dependencies with an updated version so it is not your responsability to manage versions. However if libraries dont match then you can do as I did and verify versions yourself but this is not recommended.

moshi100 commented 5 years ago

After 2 days trying to fix it I found a solution, in my case the following plugins caused a crash: cordova-admob-sdk, cordova-plugin-firebase and I changed manually the play-services-ads version in "project.properties" and "build.gradle" files from "com.google.android.gms:play-services-ads:+" to "com.google.android.gms:play-services-ads:16.0.0"

tracy-codes commented 5 years ago

@michalakjan Thank you so much for your suggestion, this worked perfectly for me. I know adding another dependency isn't the greatest thing to do... but I'm just trying to learn native Google Auth and this was the biggest pain in my ass until I found your solution. Thank you, sir.

mesqueeb commented 5 years ago

thanks for this

kurtiev commented 5 years ago

@Lucasq95 @hikelvin Thanks a lot!

ulrick commented 4 years ago

This solved my problem also. Thanks :)

DuaneQ commented 4 years ago

I'm getting the same error as @matjazonline after manually changing the project properties to +. Any suggestions for those cases?