flutterfire
flutterfire copied to clipboard
flutterfire_ui 0.4.0 Google Sign In Error on Android and macOS desktop
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.
yes
yes
I have the old version It has no problems with google sign in
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.
The solution //
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
.
@Splashman777 what platform are you experiencing this issue?
Macos
في ٠٤/٠٤/٢٠٢٢ الساعة ٢:٥٧ م، كتب/كتبت Andrei Lesnitsky @.***>:
@Splashman777 what platform are you experiencing this issue?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
@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?
@lesnitsky Android. I have all my SHA keys set up in Firebase and everything has been working on other versions besides 0.4.0
I have a similar issue on macOS for both Google and Apple sign in.
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.
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:
- click on Google login
- pick a Google account from the picker
- 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.
I'm looking into it
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".
@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.
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
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
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.
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 .
- 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)
- 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