Skip to content

flutterfire_ui 0.4.0 Google Sign In Error on Android and macOS desktop #8384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Splashman777 opened this issue Apr 2, 2022 · 19 comments · Fixed by #9343
Closed

flutterfire_ui 0.4.0 Google Sign In Error on Android and macOS desktop #8384

Splashman777 opened this issue Apr 2, 2022 · 19 comments · Fixed by #9343
Assignees
Labels
platform: android Issues / PRs which are specifically for Android. platform: macos Issues / PRs which are specifically for MacOS. plugin: ui resolution: fixed A fix has been merged or is pending merge from a PR.

Comments

@Splashman777
Copy link

Splashman777 commented Apr 2, 2022

I upgraded flutterfire_ui from 0.3.6+1 to 0.4.0 and Google Sign In button no longer works. It always says "An unknown error occurred". I can't find anything in the logs for further info. Switched back to 0.3.6+1 and it works fine.

The only thing I could find while debugging was this: "com.google.android.gms.common.api.ApiException: 10: null". Sounds like I might have something set up wrong but I've only had a problem with this version so I'm confused.

@ghost

This comment was marked as duplicate.

@ghost
Copy link

ghost commented Apr 4, 2022

yes
Screen Shot 1443-09-03 at 1 13 45 AM

I have the old version
It has no problems with google sign in

@ghost

This comment was marked as duplicate.

@ghost
Copy link

ghost commented Apr 4, 2022

The solution //
Screen Shot 1443-09-03 at 5 29 40 AM

@darshankawar darshankawar added the triage Issue is currently being triaged. label Apr 4, 2022
@darshankawar
Copy link

darshankawar commented Apr 4, 2022

Thanks for the report. Seeing the same using latest version. Verified this on Android device (S10).

stable, master flutter doctor -v

[✓] Flutter (Channel stable, 2.10.4, on macOS 12.2.1 21D62 darwin-x64, locale
    en-GB)
    • Flutter version 2.10.4 at /Users/dhs/documents/fluttersdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c860cba910 (3 days ago), 2022-03-25 00:23:12 -0500
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

[✓] Flutter (Channel master, 2.13.0-0.0.pre.366, on macOS 12.2.1 21D62
    darwin-x64, locale en-GB)
    • Flutter version 2.13.0-0.0.pre.366 at
      /Users/dhs/documents/fluttersdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 0b97874895 (2 days ago), 2022-04-01 21:20:01 -0400
    • Engine revision 801d8c530f
    • Dart version 2.17.0 (build 2.17.0-265.0.dev)
    • DevTools version 2.12.1

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.



/cc @lesnitsky

Please disregard the Android platform replication. It was related to my SHA key and re-registering it got it working for me on Android. So this doesn't seem to be specific to mobile platform.

I can confirm this behavior on macOS wherein I am seeing 400 server response with Missing required paramter: scope.

@darshankawar darshankawar added plugin: ui and removed triage Issue is currently being triaged. labels Apr 4, 2022
@lesnitsky lesnitsky self-assigned this Apr 4, 2022
@lesnitsky
Copy link
Member

@Splashman777 what platform are you experiencing this issue?

@ghost
Copy link

ghost commented Apr 4, 2022 via email

@lesnitsky
Copy link
Member

@Splashman777 com.google.android.gms.common.api.ApiException: 10: null seems to be related to your emulator not being linked to the firebase project. (see this SO question).

Could you please add your emualtor sha to the firebase project and try to sign in with google again?

@darshankawar darshankawar added blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: macos Issues / PRs which are specifically for MacOS. labels Apr 4, 2022
@Splashman777
Copy link
Author

@lesnitsky Android. I have all my SHA keys set up in Firebase and everything has been working on other versions besides 0.4.0

@darshankawar darshankawar added platform: android Issues / PRs which are specifically for Android. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Apr 5, 2022
@talkbiz
Copy link

talkbiz commented Apr 19, 2022

I have a similar issue on macOS for both Google and Apple sign in.

@maks
Copy link

maks commented Apr 20, 2022

Strangely I'm getting the same "an unknown error has occurred" error message and I haven't moved off 0.3.6+1 but simply added the google_sign_in package, where previously I was only using email/password logins (which still work fine).

I should add I'm also on stable channel, using a Android 12 device and can confirm I have the debug SHA1 fingerprint added to my Firebase project config.

@workerbee22
Copy link

workerbee22 commented Apr 22, 2022

Also getting an 'An unknown error occurred' with google_sign_in ^5.3.0 and flutterfire_ui ^0.4.0+2.

This occurs when Login with Google:

  1. click on Google login
  2. pick a Google account from the picker
  3. and then on the FlutterFire UI screen returns "unknown error"

Have now also tested with flutterfire_ui ^0.3.6+1 ... still the same issue.

@lesnitsky
Copy link
Member

I'm looking into it

@etienn01
Copy link

I encountered the same issue on Android after upgrading flutterfire_ui from 0.3.6+1 to 0.4.0+5.

This change may be the reason. The clientId parameter is now passed to the GoogleSignIn constructor, and because my GoogleProviderConfiguration uses the androidClientId value, it doesn't work. Hardcoding the web clientId value fixes the issue (it's actually what's specified in the docs), but on the other side, the docs of GoogleSignIn.clientId states that it is "Only supported on web".

@workerbee22
Copy link

workerbee22 commented May 12, 2022

@etienn01 Specifying the clientId does not work for me.

I'm using google_sign_in ^5.3.1 and flutterfire_ui ^0.4.0+5
I always have included the hard coded web clientId with my GoogleProviderConfiguration as well, because yes as you point out it has always said to use this clientId.

But still get the "An unknown error occurred" when using 'Sign in with Google'. Email/password sign in and Sign in with Apple both still working fine.

UPDATE: Have now upgraded to flutterfire_ui ^0.4.1 with Flutter v3, retested, but still have the same issue.
UPDATE: Retested with flutterfire_ui 0.4.1+1 and Flutter v3, but still have the same issue.

@7AveNooN7
Copy link

I have the same issue. Google SignIn button works only with version of flutterfire_ui smaller than 4.0.0. In other case 'An unknown error occured' happens. IDE: Android Studio, google_sin_in: 5.3.0

@prgtrdr
Copy link

prgtrdr commented Jul 9, 2022

Using flutterfire_ui version 0.4.2 I have the same issue debugging on 1)Samsung SM-G900V running Android 6.0.1, and 2)Samsung SM-G950U running Android 9. Same project runs on iPhone and iPad with no problems with Sign in with Google.

Flutter Doctor:
[✓] Flutter (Channel stable, 3.0.4, on macOS 12.4 21F79 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.69.0)
[✓] Connected device (3 available)
! Device emulator-5562 is offline.
[✓] HTTP Host Availability

• No issues found!

@lesnitsky

@lesnitsky lesnitsky changed the title flutterfire_ui 0.4.0 Google Sign In Error flutterfire_ui 0.4.0 Google Sign In Error on desktop Jul 14, 2022
@workerbee22
Copy link

Update which shows we have a clear conflicting requirements around the id.

Trying to use SignInView I currently specify in my Google Provider Configs the clientId because it is required.

I'm using the latest:

google_sign_in ^5.4.0
flutterfire_ui ^0.4.3

Result when the app runs on Android is this warning:
W/google_sing_in(13914): clientId is not supported on Android and is interpreted as serverClientId.Use serverClientId instead to suppress this warning.

So clientId is required by the const GoogleProviderConfiguration as part of passing providerConfigs to SignInView. But problem is that we don't yet have available to us serverClientId, although warning says it interprets clientId as serverClientId ? So kinda confusing.

@MousyBusiness
Copy link

I've just hit this and I think the warning is a red herring...
Other than the normal 100million cleans, version changes and rebuilds, I did two things that eventually go this working again .

  1. APIs & Services > OAuth Consent Screen > Edit app... (There was a new email requirement and my scope were empty, I added "openid",
    "https://www.googleapis.com/auth/userinfo.email",
    "https://www.googleapis.com/auth/userinfo.profile", and matched it in the GoogleProviderConfiguration)
  2. Nuked my Android Firebase configuration by deleting the SHA keys and re-inputting. This required a firebase configuration re-run and updated ios and android google configs.

Hopefully one of those two things helps the rest of you (I assume it's the first one). I believe there is a decent delay after changing the OAuth Consent Sceen, so give it an hour

@darshankawar darshankawar changed the title flutterfire_ui 0.4.0 Google Sign In Error on desktop flutterfire_ui 0.4.0 Google Sign In Error on Android and macOS desktop Aug 25, 2022
@lesnitsky lesnitsky added this to the [UI] Stable release milestone Sep 16, 2022
@lesnitsky lesnitsky linked a pull request Sep 16, 2022 that will close this issue
10 tasks
@darshankawar darshankawar added the resolution: fixed A fix has been merged or is pending merge from a PR. label Oct 17, 2022
@firebase firebase locked and limited conversation to collaborators Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: android Issues / PRs which are specifically for Android. platform: macos Issues / PRs which are specifically for MacOS. plugin: ui resolution: fixed A fix has been merged or is pending merge from a PR.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants