Skip to content

Commit eaec1e1

Browse files
[google_sign_in] Add more serverClientId info to README
When I wrote the docs I thought that Firebase would always include a web OAuth client ID, but it appears that this is not always the case (e.g., https://stackoverflow.com/questions/55572583/google-services-json-missing-client-type-3) so this adds more docs about what is required for this to work correctly. Also adds a note that a missing ID error could be due to incorrect gradle configuration, as that's not necessarily clear from the Firebase docs. Fixes flutter/flutter#172073
1 parent 2b0ecd2 commit eaec1e1

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

packages/google_sign_in/google_sign_in_android/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 7.0.3
2+
3+
* Add more details and troubleshooting for `serverClientId` configuration
4+
via Firebase.
5+
16
## 7.0.2
27

38
* Adds a README note about potentially confusing error returns from

packages/google_sign_in/google_sign_in_android/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ To use Google Sign-In, you'll need to register your application, either
2222

2323
* If you are use the `google-services.json` file and Gradle-based registration
2424
system, no identifiers need to be provided in Dart when initializing the
25-
`GoogleSignIn` instance when running on Android.
25+
`GoogleSignIn` instance when running on Android, as long as your
26+
`google-services.json` contains a web OAuth client entry.
2627
* If you are not using `google-services.json`, you need to pass the client
2728
ID of the *web* application you registered as the `serverClientId` when
2829
initializing the `GoogleSignIn` instance.
@@ -51,6 +52,16 @@ errors include:
5152
* Sign-in working in one build configuration but not another.
5253

5354
Common sources of configuration errors include:
54-
* Missing or incorrect `serverClientId`.
5555
* Missing or incorrect signing SHA for one or more build configurations.
5656
* Incorrect Android package name on the server side.
57+
* Missing or incorrect `serverClientId`.
58+
59+
If you are using `google-services.json` and recieve a "serverClientId must be
60+
provided on Android" error message, check that:
61+
* Your `google-services.json` contains a web OAuth client, which should be an
62+
`oauth_client` entry with `client_type: 3`. This should have been created
63+
automatically when enabling Google Sign In using the Firebase console, but
64+
if not (or if it was later removed), add a web app to the project and then
65+
re-download `google-services.json`.
66+
* You correctly added followed all of the Gradle configuration steps in the
67+
Firebase integration documentation.

packages/google_sign_in/google_sign_in_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: google_sign_in_android
22
description: Android implementation of the google_sign_in plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_android
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
5-
version: 7.0.2
5+
version: 7.0.3
66

77
environment:
88
sdk: ^3.6.0

0 commit comments

Comments
 (0)