CrossGeeks / GoogleClientPlugin

Google Client Plugin for Xamarin iOS and Android
https://www.pujolsluis.com/google-client-plugin-for-xamarin/
MIT License
89 stars 37 forks source link

The sign in attempt didn't succeed with the current account (Android) #65

Open Axemasta opened 4 years ago

Axemasta commented 4 years ago

I've followed the documentation, created my firebase project & apps and have integrated the library into my app. The app signs in as expected on iOS, no complaints there.

On Android as soon as I call LoginAsync() the following exception is thrown: The exception

I have confirmed that the app package names match:

Manifest: Manifest app name

Firebase: Firebase app name

I have also confirmed the signing certificate sha's are the same. I got the first sha from the keystore and that was exactly the same as the PrintShaHash() method provided in the docs for this plugin.

I've downloaded the json from the console and added it to my project: Android json in the project

I then tried running the sample provided by the library, changing the package name & json files. I get the same error on the sample app, you just end up with the following message:

Error message

The MainActivity in the sample has the init code already there:

GoogleClientManager.Initialize(this);
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
    base.OnActivityResult(requestCode, resultCode, data);
    GoogleClientManager.OnAuthCompleted(requestCode, resultCode, data);
}

Any ideas on how I can resolve these issues? they look to be with the configuration of the android app in firebase. I noticed that for the iOS app I had to submit a consent screen before it would work. However the app threw an exception to tell me this, it didn't just say login failed before I ever get prompted for my users credentials.

Smartphone

Pujolsluis commented 4 years ago

Hi @Axemasta ,

Great issue report! That's strange. . . Mmm I'll be looking into this when I get some free time later in the day.

leaguefun commented 4 years ago

@Axemasta Hi, I'd also hit the same before, however, after I enabled the "Sign-In" method for Google, it solved. image

Axemasta commented 4 years ago

@leaguefun I had a look at my firebase console and this option was already enabled 😔 , I did try disabling and reenabling it but no avail!

DavidNolc commented 3 years ago

@Axemasta if you are still looking for a solution i had this and found that the "User type" under "OAuth consent screen" was on "Internal", make it "External" and maybe will work (this is in the Google Cloud Console)

AndreyKotkovDev commented 1 year ago

Hi,

I'm experiencing some strange behavior. Using Xamarin Forms and when running the app on emulator with API 30 I get an exception: "Plugin.GoogleClient.Shared.GoogleClientSignInFailedErrorException: The sign in attempt didn't succeed with the current account" but when using emulator with API level 33 it works fine.

Any ideas?