Repository navigation
Google Sign In render button issue in latest version for flutter web #149236
Copy link
Copy link
Closed
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 3.22Found to occur in 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23Found to occur in 3.23has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: google_sign_inThe Google Sign-In pluginThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-webWeb applications specificallyWeb applications specificallyr: solvedIssue is closed as solvedIssue is closed as solvedteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Description
Steps to reproduce
Try to use google sign in plugin with latest version of it and use googleSignInPlugin.renderButton(configuration: html.getGoogleSignInButtonConfiguration(constraints.maxWidth))
Expected results
In version 3.16.0, I was able to see google sign In button but not in this version
Actual results
Button is not visible and I am getting this error in console
Code sample
Code sample
Expanded(
child: LayoutBuilder(
builder: (context, constraints) {
return SizedBox(
height: 48,
child: googleSignInPlugin
.renderButton(
configuration: html
.getGoogleSignInButtonConfiguration(
constraints.maxWidth),
),
);
}),
),Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
Error
http://localhost:62424/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 296:3 throw_
http://localhost:62424/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3 assertFailed
http://localhost:62424/packages/google_sign_in_web/src/flexible_size_html_element_view.dart 101:16 [_registerListeners]
http://localhost:62424/packages/google_sign_in_web/src/flexible_size_html_element_view.dart 117:13
http://localhost:62424/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
http://localhost:62424/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5 _async
http://localhost:62424/packages/google_sign_in_web/src/flexible_size_html_element_view.dart 116:39
http://localhost:62424/packages/flutter/src/widgets/_html_element_view_web.dart 65:30
http://localhost:62424/dart-sdk/lib/async/zone.dart 1661:54 runUnary
http://localhost:62424/dart-sdk/lib/async/future_impl.dart 163:18 handleValue
http://localhost:62424/dart-sdk/lib/async/future_impl.dart 847:44 handleValueCallback
http://localhost:62424/dart-sdk/lib/async/future_impl.dart 876:13 _propagateToListeners
http://localhost:62424/dart-sdk/lib/async/future_impl.dart 652:5 [_completeWithValue]
http://localhost:62424/dart-sdk/lib/async/future_impl.dart 722:7 callback
http://localhost:62424/dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
http://localhost:62424/dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
http://localhost:62424/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.4.1 23E224 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 14.3)
! Flutter recommends a minimum Xcode version of 15.
Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] Connected device (4 available)
[✓] Network resources
! Doctor found issues in 1 category.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 3.22Found to occur in 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23Found to occur in 3.23has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: google_sign_inThe Google Sign-In pluginThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-webWeb applications specificallyWeb applications specificallyr: solvedIssue is closed as solvedIssue is closed as solvedteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Activity
darshankawar commentedon May 29, 2024
@jaydeepkaria-mi Is this coming from https://pub.dev/packages/google_sign_in ? I tried with it, but couldn't get the implementation correct ?
Can you elaborate on that usage and provide us complete code sample ?
jaydeepkaria-mi commentedon May 30, 2024
Code of pubspec
Code of main.dart
Code of html_lib
Try this code. It will give the error
darshankawar commentedon May 31, 2024
@jaydeepkaria-mi
I tried above code but it is not rendering anything, as below:
Can you switch to latest master and re-run your scenario to check if the reported error persists in it or not ?
jaydeepkaria-mi commentedon May 31, 2024
Yup, @darshankawar that is what the issue is. Due to the Google sign-in button render issue other text is not showing. The same code works for me in version 3.16.0 and the Google sign-in button is visible. I am getting the error you can check the

screenshot
darshankawar commentedon May 31, 2024
Thanks for the update. Although I am seeing a blank screen in web, but I don't see the exception log in the console. I tried this on stable 3.16.0, 3.16.9 and 3.22.1.
However, I do see the reported exception log running the same code in latest master version:
Maybe related to #131452 ?
master flutter doctor -v
runnable code sample
13 remaining items
ditman commentedon Jun 4, 2024
I suspect the issue is in the users' code, since the
button_testerapplication works just fine. Here's the instructions on how to run it (inside theexampleofgoogle_sign_in_web):ditman commentedon Jun 4, 2024
There's two issues here:
initmethod of the plugin needs to have aclientId, either passed toinitas a parameter, or in ametatag (instructions).Errorthat is being printed to the JS Console does not reflect the whole text of the failed assertion, making it harder to come up with a fix. It should say something like:A possible fix to the repro case in this test is to do the following:
ditman commentedon Jun 4, 2024
Please @jaydeepkaria-mi, let me know if the explanation above makes sense so we can close this issue!
jaydeepkaria-mi commentedon Jun 5, 2024
@ditman Thanks, I got your point. You can close the issue :)
[google_sign_in_web] Update button_tester to use web_only library. (#…
ditman commentedon Jun 5, 2024
Thanks for reporting @jaydeepkaria-mi! Closing!
github-actions commentedon Jun 21, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.