EddyVerbruggen / cordova-plugin-googleplus

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

Conflict between cordova-plugin-googleplus and cordova-plugin-fcm #283

Open maxper75 opened 7 years ago

maxper75 commented 7 years ago

Hi, as I put together in one application these plugins, even for a just created application I get a build error.

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

And after

BUILD FAILED

Total time: 1.229 secs Error: /opt/sviluppo/cordova/gplusLogin/platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

  • What went wrong: 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.2.0.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I suppose there's some version conflict between the two plugins, and I suppose that if there's no dependency problem I could just try to upgrade this plugin to use the other library, but I don't really know how to do this... Let me know, thanks!

maxper75 commented 7 years ago

Hi, I succeeded by uninstalling and installing the plugin again, changing the dependencies, to use the plugin with the other version 9.2.0. The actual problem is that it tells that this plugin uses deprecated calls... What should I change? Is it worth?

EddyVerbruggen commented 7 years ago

You can ignore the deprecation warnings. Those things will always pop up somewhere in your software as time progresses.

ghost commented 7 years ago

You have to change the "+" in project.properties in the android platform folder with 9.2.0

J-Yen commented 7 years ago

I have the same problem, can someone please give me an explanation how to fix this?

My error is the following: 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. :processDebugGoogleServices FAILED But if i change the version to 9.0.0 in project.properties (ionic/cordova) i get an error inside "GooglePlus.java:151: error: cannot access AbstractSafeParcelable.addApi(Auth.GOOGLE_SIGN_IN_API, gso.build());".

jabit commented 6 years ago

Here the same problem. I can not run the app with "phonegap-plugin-push 1.10.4" together.

I am on Ubuntu 16.04 using cordova 7.0.1 and Android Studio 2.3.3. cordova plugin ls: cordova-plugin-googleplus 5.1.1 "Google SignIn" (I have tried v. 5.1.0 as well with same result) cordova-plugin-whitelist 1.3.2 "Whitelist" phonegap-plugin-push 1.10.4 "PushPlugin" cordova -v: 7.0.1

cordova requirements android: Requirements check results for android: Java JDK: installed 1.8.0 Android SDK: installed true Android target: installed android-26,android-25 Gradle: installed /opt/gradle/gradle-3.5/bin/gradle

BUILD FAILED

Total time: 10.959 secs Error: /home/javier/cordova/sportybetty/platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

Wenn I uninstall cordova-plugin-googleplus everything works perfectly. How could I fix that? tnx

pseglar commented 6 years ago

-->Wenn I uninstall cordova-plugin-googleplus everything works perfectly. How could I fix that? Same problem here.

jabit commented 6 years ago

@pseglar as you write the problem come from "cordova-plugin-googleplus" I found a solution changing the library version on project.propierties this way:

file: platforms/android/project.propierties: change: cordova.system.library.1=com.google.android.gms:play-services-auth:+ cordova.system.library.2=com.google.android.gms:play-services-identity:+ cordova.system.library.3=com.google.android.gms:play-services-gcm:+

To: cordova.system.library.1=com.google.android.gms:play-services-auth:10.2+ cordova.system.library.2=com.google.android.gms:play-services-identity:10.2+ cordova.system.library.3=com.google.android.gms:play-services-gcm:10.2+

You can put the version numbre witout +, so: cordova.system.library.3=com.google.android.gms:play-services-gcm:10.2

Now everything works like a charm. I hope this helps!

pseglar commented 6 years ago

As you said. It worked like a charm! Thanks you very much.

Any idea how to set up this inside ionic project in order to set up this parameters on the next "platform build" ?

On Fri, Jun 16, 2017 at 1:34 PM, Javier Aranda (JaBit) < notifications@github.com> wrote:

@pseglar https://github.com/pseglar as you write the problem come from "cordova-plugin-googleplus" I found a solution changing the library version on project.propierties this way:

file: platforms/android/project.propierties: change: cordova.system.library.1=com.google.android.gms:play-services-auth:+ cordova.system.library.2=com.google.android.gms:play-services-identity:+ cordova.system.library.3=com.google.android.gms:play-services-gcm:+

To: cordova.system.library.1=com.google.android.gms:play-services-auth:10.2+ cordova.system.library.2=com.google.android.gms:play- services-identity:10.2+ cordova.system.library.3=com.google.android.gms:play-services-gcm:10.2+

You can put the version numbre witout +, so: cordova.system.library.3=com.google.android.gms:play-services-gcm:10.2

Now everything works like a charm. I hope this helps!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/283#issuecomment-309003435, or mute the thread https://github.com/notifications/unsubscribe-auth/AKj_zBTE-yuIEcvpWdS6z7H-eqVh4KDjks5sEmgtgaJpZM4KDCQK .

jabit commented 6 years ago

you are welcome @pseglar! but aubout your question, I have no idea how to do that on ionic :( good luck and have fun!!

elewin commented 6 years ago

I'm having the same problem as J-Yen, changing the version numbers from + to 9.0.0 results in:

platforms\android\src\nl\xservices\plugins\GooglePlus.java:151: error: cannot access AbstractSafeParcelable .addApi(Auth.GOOGLE_SIGN_IN_API, gso.build()); ^ class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found

App builds fine with the plugin removed, and I've also tried all the suggestions from issue #349

I have this conflict when using googleplus with either the cordova-plugin-firebase plugin and cordova-plugin-fcm installed with it.

amit777 commented 6 years ago

@elewin sorry for the late post, but have you had any success with this? trying to get googleplus and fcm plugins working together on android.

G-arun commented 6 years ago

Any one resolved ? facing same issue like @elewin

sebj54 commented 6 years ago

I have the same problem. Like @jabit said, it worked when I changed these lines from project.properties file:

cordova.system.library.6=com.google.android.gms:play-services-auth:+
cordova.system.library.7=com.google.android.gms:play-services-identity:+

To:

cordova.system.library.6=com.google.android.gms:play-services-auth:11.0.1
cordova.system.library.7=com.google.android.gms:play-services-identity:11.0.1

I had to used the same version used by phonegap-plugin-push plugin (line below found in the same file):

cordova.system.library.5=com.google.firebase:firebase-messaging:11.0.1

Anyone knows a way to make this work permanently so it is not erased when I make another clean + build?

EDIT: It builds but it doesn't seem to work. I am getting an error on login. I'm actually trying to get more logs.

emmgali commented 6 years ago

Same error as @J-Yen and @elewin. Solution from @sebj54 didn't work.

@amit777 you found something? Anyone found a solution?

hvallenilla commented 6 years ago

Hi, My conflict was between cordova-plugin-googleplus and cordova-plugin-firebase And I did change this:

The first, I did installed cordova plugin add cordova-plugin-firebase@0.1.22 --save

After, in project.properties I did change this

target=android-26 android.library.reference.1=CordovaLib cordova.gradle.include.1=cordova-fabric-plugin/myapp-build-extras.gradle cordova.system.library.1=com.facebook.android:facebook-android-sdk:4.+ cordova.system.library.2=com.google.android.gms:play-services-auth:11.8.0 cordova.system.library.3=com.google.android.gms:play-services-identity:11.8.0 cordova.gradle.include.2=cordova-plugin-firebase/myapp-build.gradle cordova.system.library.4=com.google.firebase:firebase-core:+ cordova.system.library.5=com.google.firebase:firebase-messaging:+ cordova.system.library.6=com.google.firebase:firebase-crash:+ cordova.system.library.7=com.google.firebase:firebase-config:+

For this

target=android-26 android.library.reference.1=CordovaLib cordova.gradle.include.1=cordova-fabric-plugin/myapp-build-extras.gradle cordova.system.library.1=com.facebook.android:facebook-android-sdk:4.+ cordova.system.library.2=com.google.android.gms:play-services-auth:15.0.0 cordova.system.library.3=com.google.android.gms:play-services-identity:15.0.0 cordova.gradle.include.2=cordova-plugin-firebase/myapp-build.gradle cordova.system.library.4=com.google.firebase:firebase-core:15.0.0 cordova.system.library.5=com.google.firebase:firebase-messaging:15.0.0 cordova.system.library.6=com.google.firebase:firebase-crash:15.0.0 cordova.system.library.7=com.google.firebase:firebase-config:15.0.0

And work it

MrDrProfX commented 6 years ago

Awesome. Found this after 2 days of red herrings.

The root cause here is the android project gets confused because we're telling it to import multiple versions of the same thing. In my case:

cordova.system.library.1=com.google.android.gms:**play-services-base**:11.0.4 and cordova.system.library.12=com.google.android.gms:**play-services-identity**:11.8.0

The solution is to make the numbers match. In my case I picked 11.0.4.

zowpro commented 4 years ago

This worked for me, i just updated the code of project.properties (platforms/android/) : cordova.system.library.10=com.google.android.gms:play-services-auth:9.2.0 cordova.system.library.11=com.google.android.gms:play-services-identity:9.2.0 Just change the number of version to 9.2.0

kundansakpal commented 4 years ago

In Android build.gradle file add dependencies as same version for Eg 10.+