cordova-plugin-googleplus
cordova-plugin-googleplus copied to clipboard
plugin not working with cordova-plugin-firebase
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
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
@Lucasq95 you are the man!
I get still get this after adding the plugin to ionic 3 with firebase:
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
-
Get more help at https://help.gradle.org
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.
- What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
@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.
@matjazonline Did anyone found a solution ?
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 ?
ok, i will try this one. also can you let me know how to implement this on phonegap build
@MisaZ10 Is there possibility to define these versions via ionic/cordova?
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:+" />
@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 🙂
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>
Thanks @Lucasq95 :100: your described solution worked for me!
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:+
@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.
@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.
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"
@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.
thanks for this
@Lucasq95 @hikelvin Thanks a lot!
This solved my problem also. Thanks :)
I'm getting the same error as @matjazonline after manually changing the project properties to +. Any suggestions for those cases?