firebase / FirebaseUI-Flutter

Apache License 2.0
91 stars 79 forks source link

GoogleProvider does not compile on Web #286

Closed grant-traynor closed 4 months ago

grant-traynor commented 4 months ago

Is there an existing issue for this?

What plugin is this bug for?

Firebase UI OAuth Google

What platform(s) does this bug affect?

Web

List of dependencies used.

flutter pub deps -s list
Dart SDK 3.2.6
Flutter SDK 3.16.9
senpai 1.0.0+1

dependencies:
- flutter 0.0.0
  - characters 1.3.0
  - collection 1.18.0
  - material_color_utilities 0.5.0
  - meta 1.10.0
  - vector_math 2.1.4
  - web 0.3.0
  - sky_engine any
- intl 0.18.1
  - clock ^1.1.0
  - meta ^1.0.2
  - path ^1.8.0
- meta 1.10.0
- equatable 2.0.5
  - collection ^1.15.0
  - meta ^1.3.0
- bloc 8.1.2
  - meta ^1.3.0
- flutter_bloc 8.1.3
  - bloc ^8.1.1
  - flutter any
  - provider ^6.0.0
- hydrated_bloc 9.1.3
  - bloc ^8.1.1
  - hive ^2.0.0
  - meta ^1.3.0
  - synchronized ^3.0.0
- path_provider 2.1.2
  - flutter any
  - path_provider_android ^2.1.0
  - path_provider_foundation ^2.3.0
  - path_provider_linux ^2.2.0
  - path_provider_platform_interface ^2.1.0
  - path_provider_windows ^2.2.0
- google_fonts 6.1.0
  - flutter any
  - http ^1.0.0
  - path_provider ^2.0.0
  - crypto ^3.0.0
- timeline_tile 2.0.0
  - flutter any
- card_swiper 3.0.1
  - flutter any
- firebase_core 2.25.4
  - firebase_core_platform_interface ^5.0.0
  - firebase_core_web ^2.11.4
  - flutter any
  - meta ^1.8.0
- firebase_app_check 0.2.1+13
  - firebase_app_check_platform_interface ^0.1.0+15
  - firebase_app_check_web ^0.1.0+15
  - firebase_core ^2.25.4
  - firebase_core_platform_interface ^5.0.0
  - flutter any
- firebase_analytics 10.8.5
  - firebase_analytics_platform_interface ^3.9.5
  - firebase_analytics_web ^0.5.5+17
  - firebase_core ^2.25.4
  - firebase_core_platform_interface ^5.0.0
  - flutter any
- cloud_firestore 4.15.4
  - cloud_firestore_platform_interface ^6.1.5
  - cloud_firestore_web ^3.10.4
  - collection ^1.0.0
  - firebase_core ^2.25.4
  - firebase_core_platform_interface ^5.0.0
  - flutter any
  - meta ^1.8.0
- firebase_auth 4.17.4
  - firebase_auth_platform_interface ^7.1.4
  - firebase_auth_web ^5.9.4
  - firebase_core ^2.25.4
  - firebase_core_platform_interface ^5.0.0
  - flutter any
  - meta ^1.8.0
- firebase_ui_auth 1.13.0
  - email_validator ^2.1.17
  - firebase_auth ^4.15.3
  - firebase_core ^2.24.2
  - firebase_dynamic_links ^5.4.8
  - firebase_ui_localizations ^1.10.2
  - firebase_ui_oauth ^1.5.0
  - firebase_ui_shared ^1.4.1
  - flutter any
  - flutter_localizations any
  - meta ^1.10.0
- firebase_ui_oauth_apple 1.2.18
  - firebase_auth ^4.15.3
  - firebase_ui_oauth ^1.5.0
  - flutter any
- firebase_ui_oauth_facebook 1.2.18
  - firebase_auth ^4.15.3
  - firebase_ui_oauth ^1.5.0
  - flutter any
  - flutter_facebook_auth ^6.0.3
- firebase_ui_oauth_google 1.3.0
  - firebase_auth ^4.15.3
  - firebase_ui_oauth ^1.5.0
  - flutter any
  - google_sign_in ^6.2.1
- google_sign_in 6.2.1
  - flutter any
  - google_sign_in_android ^6.1.0
  - google_sign_in_ios ^5.7.0
  - google_sign_in_platform_interface ^2.4.0
  - google_sign_in_web ^0.12.0
- flutter_facebook_auth 6.0.4
  - flutter any
  - flutter_facebook_auth_platform_interface ^5.0.0
  - flutter_facebook_auth_web ^5.0.0
- segmented_progress_bar 1.1.0
  - flutter any
- flutter_animate 4.5.0
  - flutter any
  - flutter_shaders ^0.1.2

dev dependencies:
- flutter_test 0.0.0
  - flutter any
  - test_api 0.6.1
  - matcher 0.12.16
  - path 1.8.3
  - fake_async 1.3.1
  - clock 1.1.1
  - stack_trace 1.11.1
  - vector_math 2.1.4
  - async 2.11.0
  - boolean_selector 2.1.1
  - characters 1.3.0
  - collection 1.18.0
  - material_color_utilities 0.5.0
  - meta 1.10.0
  - source_span 1.10.0
  - stream_channel 2.1.2
  - string_scanner 1.2.0
  - term_glyph 1.2.1
  - web 0.3.0
- flutter_lints 3.0.1
  - lints ^3.0.0
- dependency_validator 3.2.3
  - args ^2.0.0
  - build_config ^1.0.0
  - checked_yaml ^2.0.1
  - glob ^2.0.1
  - io ^1.0.0
  - json_annotation ^4.8.0
  - logging ^1.0.1
  - package_config ^2.0.0
  - path ^1.8.0
  - pub_semver ^2.0.0
  - pubspec_parse ^1.0.0
  - yaml ^3.1.0
- flutter_launcher_icons 0.13.1
  - args ^2.3.2
  - checked_yaml ^2.0.2
  - cli_util ^0.4.0
  - image ^4.0.15
  - json_annotation ^4.8.0
  - path ^1.8.2
  - yaml ^3.1.1
- flutter_native_splash 2.3.10
  - args ^2.4.2
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.7
  - html ^0.15.4
  - image ^4.1.3
  - meta ^1.10.0
  - path ^1.8.3
  - universal_io ^2.2.2
  - xml ^6.5.0
  - yaml ^3.1.2
  - ansicolor ^2.0.2

transitive dependencies:
- _flutterfire_internals 1.3.21
  - collection ^1.0.0
  - firebase_core ^2.25.4
  - firebase_core_platform_interface ^5.0.0
  - flutter any
  - meta ^1.8.0
- ansicolor 2.0.2
- archive 3.4.10
  - crypto ^3.0.3
  - path ^1.8.0
  - pointycastle ^3.7.3
- args 2.4.2
- async 2.11.0
  - collection ^1.15.0
  - meta ^1.1.7
- boolean_selector 2.1.1
  - source_span ^1.8.0
  - string_scanner ^1.1.0
- build_config 1.1.1
  - checked_yaml ^2.0.0
  - json_annotation ^4.5.0
  - path ^1.8.0
  - pubspec_parse ^1.0.0
  - yaml ^3.0.0
- characters 1.3.0
- checked_yaml 2.0.3
  - json_annotation ^4.3.0
  - source_span ^1.8.0
  - yaml ^3.0.0
- cli_util 0.4.1
  - meta ^1.3.0
  - path ^1.8.0
- clock 1.1.1
- cloud_firestore_platform_interface 6.1.5
  - _flutterfire_internals ^1.3.21
  - collection ^1.15.0
  - firebase_core ^2.25.4
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- cloud_firestore_web 3.10.4
  - _flutterfire_internals ^1.3.21
  - cloud_firestore_platform_interface ^6.1.5
  - collection ^1.0.0
  - firebase_core ^2.25.4
  - firebase_core_web ^2.11.4
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.3
- collection 1.18.0
- convert 3.1.1
  - typed_data ^1.3.0
- crypto 3.0.3
  - typed_data ^1.3.0
- csslib 1.0.0
  - source_span ^1.8.0
- desktop_webview_auth 0.0.15
  - crypto ^3.0.3
  - flutter any
  - http ^1.0.0
  - flutter_web_plugins any
  - plugin_platform_interface ^2.1.4
- email_validator 2.1.17
- fake_async 1.3.1
  - clock ^1.1.0
  - collection ^1.15.0
- ffi 2.1.0
- file 7.0.0
  - meta ^1.9.1
  - path ^1.8.3
- firebase_analytics_platform_interface 3.9.5
  - _flutterfire_internals ^1.3.21
  - firebase_core ^2.25.4
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_analytics_web 0.5.5+17
  - _flutterfire_internals ^1.3.21
  - firebase_analytics_platform_interface ^3.9.5
  - firebase_core ^2.25.4
  - firebase_core_web ^2.11.4
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.3
- firebase_app_check_platform_interface 0.1.0+15
  - _flutterfire_internals ^1.3.21
  - firebase_core ^2.25.4
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_app_check_web 0.1.0+15
  - _flutterfire_internals ^1.3.21
  - firebase_app_check_platform_interface ^0.1.0+15
  - firebase_core ^2.25.4
  - firebase_core_web ^2.11.4
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.3
- firebase_auth_platform_interface 7.1.4
  - _flutterfire_internals ^1.3.21
  - collection ^1.16.0
  - firebase_core ^2.25.4
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_auth_web 5.9.4
  - firebase_auth_platform_interface ^7.1.4
  - firebase_core ^2.25.4
  - firebase_core_web ^2.11.4
  - flutter any
  - flutter_web_plugins any
  - http_parser ^4.0.0
  - js ^0.6.3
  - meta ^1.8.0
  - web >=0.3.0 <0.5.0
- firebase_core_platform_interface 5.0.0
  - collection ^1.0.0
  - flutter any
  - flutter_test any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_core_web 2.11.4
  - firebase_core_platform_interface ^5.0.0
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.3
  - meta ^1.8.0
  - web >=0.3.0 <0.5.0
- firebase_dynamic_links 5.4.13
  - firebase_core ^2.25.4
  - firebase_core_platform_interface ^5.0.0
  - firebase_dynamic_links_platform_interface ^0.2.6+21
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_dynamic_links_platform_interface 0.2.6+21
  - _flutterfire_internals ^1.3.21
  - firebase_core ^2.25.4
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_ui_localizations 1.10.2
  - flutter any
  - flutter_localizations any
  - path ^1.8.3
- firebase_ui_oauth 1.5.0
  - desktop_webview_auth ^0.0.14
  - firebase_auth ^4.15.3
  - firebase_ui_auth ^1.13.0
  - firebase_ui_shared ^1.4.1
  - flutter_svg ^2.0.9
  - flutter any
- firebase_ui_shared 1.4.1
  - flutter any
- flutter_facebook_auth_platform_interface 5.0.0
  - flutter any
  - plugin_platform_interface ^2.1.4
- flutter_facebook_auth_web 5.0.0
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.3
  - flutter_facebook_auth_platform_interface ^5.0.0
- flutter_localizations 0.0.0
  - flutter any
  - intl 0.18.1
  - characters 1.3.0
  - clock 1.1.1
  - collection 1.18.0
  - material_color_utilities 0.5.0
  - meta 1.10.0
  - path 1.8.3
  - vector_math 2.1.4
  - web 0.3.0
- flutter_shaders 0.1.2
  - flutter any
  - vector_math ^2.1.4
- flutter_svg 2.0.9
  - flutter any
  - vector_graphics ^1.1.9+1
  - vector_graphics_codec ^1.1.9+1
  - vector_graphics_compiler ^1.1.9+1
- flutter_web_plugins 0.0.0
  - flutter any
  - characters 1.3.0
  - collection 1.18.0
  - material_color_utilities 0.5.0
  - meta 1.10.0
  - vector_math 2.1.4
  - web 0.3.0
- glob 2.1.2
  - async ^2.5.0
  - collection ^1.15.0
  - file >=6.1.3 <8.0.0
  - path ^1.8.0
  - string_scanner ^1.1.0
- google_identity_services_web 0.3.0+2
  - meta ^1.3.0
  - web >=0.3.0 <0.5.0
- google_sign_in_android 6.1.21
  - flutter any
  - google_sign_in_platform_interface ^2.2.0
- google_sign_in_ios 5.7.3
  - flutter any
  - google_sign_in_platform_interface ^2.2.0
- google_sign_in_platform_interface 2.4.5
  - flutter any
  - plugin_platform_interface ^2.1.7
- google_sign_in_web 0.12.3+2
  - flutter any
  - flutter_web_plugins any
  - google_identity_services_web ^0.3.0
  - google_sign_in_platform_interface ^2.4.0
  - http >=0.13.0 <2.0.0
  - web >=0.3.0 <0.5.0
- hive 2.2.3
  - meta ^1.3.0
  - crypto ^3.0.0
- html 0.15.4
  - csslib >=0.17.0 <2.0.0
  - source_span ^1.8.0
- http 1.2.0
  - async ^2.5.0
  - http_parser ^4.0.0
  - meta ^1.3.0
  - web >=0.3.0 <0.5.0
- http_parser 4.0.2
  - collection ^1.15.0
  - source_span ^1.8.0
  - string_scanner ^1.1.0
  - typed_data ^1.3.0
- image 4.1.6
  - archive ^3.4.0
  - meta ^1.3.0
  - xml ^6.0.1
- io 1.0.4
  - meta ^1.3.0
  - path ^1.8.0
  - string_scanner ^1.1.0
- js 0.6.7
  - meta ^1.7.0
- json_annotation 4.8.1
  - meta ^1.4.0
- lints 3.0.0
- logging 1.2.0
- matcher 0.12.16
  - async ^2.10.0
  - meta ^1.8.0
  - stack_trace ^1.10.0
  - term_glyph ^1.2.0
  - test_api >=0.5.0 <0.7.0
- material_color_utilities 0.5.0
  - collection ^1.15.0
- nested 1.0.0
  - flutter any
- package_config 2.1.0
  - path ^1.8.0
- path 1.8.3
- path_parsing 1.0.1
  - vector_math ^2.1.0
  - meta ^1.3.0
- path_provider_android 2.2.2
  - flutter any
  - path_provider_platform_interface ^2.1.0
- path_provider_foundation 2.3.2
  - flutter any
  - path_provider_platform_interface ^2.1.0
- path_provider_linux 2.2.1
  - ffi >=1.1.2 <3.0.0
  - flutter any
  - path ^1.8.0
  - path_provider_platform_interface ^2.1.0
  - xdg_directories >=0.2.0 <2.0.0
- path_provider_platform_interface 2.1.2
  - flutter any
  - platform ^3.0.0
  - plugin_platform_interface ^2.1.7
- path_provider_windows 2.2.1
  - ffi ^2.0.0
  - flutter any
  - path ^1.8.0
  - path_provider_platform_interface ^2.1.0
  - win32 >=2.1.0 <6.0.0
- petitparser 6.0.2
  - meta ^1.9.0
- platform 3.1.4
- plugin_platform_interface 2.1.8
  - meta ^1.3.0
- pointycastle 3.7.4
  - collection ^1.15.0
  - convert ^3.0.0
  - js >=0.6.3 <0.8.0
- provider 6.1.1
  - collection ^1.15.0
  - flutter any
  - nested ^1.0.0
- pub_semver 2.1.4
  - collection ^1.15.0
  - meta ^1.3.0
- pubspec_parse 1.2.3
  - checked_yaml ^2.0.1
  - collection ^1.15.0
  - json_annotation ^4.8.0
  - pub_semver ^2.0.0
  - yaml ^3.0.0
- sky_engine 0.0.99
- source_span 1.10.0
  - collection ^1.15.0
  - path ^1.8.0
  - term_glyph ^1.2.0
- stack_trace 1.11.1
  - path ^1.8.0
- stream_channel 2.1.2
  - async ^2.5.0
- string_scanner 1.2.0
  - source_span ^1.8.0
- synchronized 3.1.0+1
- term_glyph 1.2.1
- test_api 0.6.1
  - async ^2.5.0
  - boolean_selector ^2.1.0
  - collection ^1.15.0
  - meta ^1.3.0
  - source_span ^1.8.0
  - stack_trace ^1.10.0
  - stream_channel ^2.1.0
  - string_scanner ^1.1.0
  - term_glyph ^1.2.0
- typed_data 1.3.2
  - collection ^1.15.0
- universal_io 2.2.2
  - collection ^1.17.0
  - meta ^1.9.0
  - typed_data ^1.3.0
- vector_graphics 1.1.10+1
  - flutter any
  - vector_graphics_codec 1.1.10+1
- vector_graphics_codec 1.1.10+1
- vector_graphics_compiler 1.1.10+1
  - args ^2.3.0
  - meta ^1.7.0
  - path_parsing ^1.0.1
  - xml ^6.3.0
  - vector_graphics_codec 1.1.10+1
  - path ^1.8.0
- vector_math 2.1.4
- web 0.3.0
- win32 5.2.0
  - ffi ^2.1.0
- xdg_directories 1.0.4
  - meta ^1.3.0
  - path ^1.8.0
- xml 6.5.0
  - collection ^1.18.0
  - meta ^1.9.0
  - petitparser ^6.0.0
- yaml 3.1.2
  - collection ^1.15.0
  - source_span ^1.8.0
  - string_scanner ^1.1.0

Steps to reproduce

import ing firebase_ui_oauth_google.dart

import 'package:firebase_ui_oauth_google/firebase_ui_oauth_google.dart' as google_auth;

Causes a web build to fail:

flutter run -d chrome --web-hostname localhost --web-port 5000
Launching lib/main.dart on Chrome in debug mode...
../../../.pub-cache/hosted/pub.dev/firebase_ui_oauth_google-1.3.0/lib/src/provider.dart:97:13:
Error: Superclass has no method named 'desktopSignIn'.
      super.desktopSignIn(action);
            ^^^^^^^^^^^^^
Waiting for connection from debug service on Chrome...                 ⣽[1]    22578 user-defined signal 1  flutter run -d chrome --web-hostname localhost --web-port 5000

Even when GoogleProvider is commented out in the auth providers list:

irebaseUIAuth.configureProviders([
    EmailAuthProvider(),
    //google_auth.GoogleProvider(clientId: googleClientId),
    apple_auth.AppleProvider(), 
 ]);

Expected Behavior

Other providers (Email and Apple) appear to be fine and function as expected.

Actual Behavior

Get the following error on compliation:

flutter run -d chrome --web-hostname localhost --web-port 5000
Launching lib/main.dart on Chrome in debug mode...
../../../.pub-cache/hosted/pub.dev/firebase_ui_oauth_google-1.3.0/lib/src/provider.dart:97:13:
Error: Superclass has no method named 'desktopSignIn'.
      super.desktopSignIn(action);
            ^^^^^^^^^^^^^
Waiting for connection from debug service on Chrome...                 ⣽[1]    22578 user-defined signal 1  flutter run -d chrome --web-hostname localhost --web-port 5000

Additional Information

I've done a quick review of the code, and can see the MixIns are there in thesign_in and sign_in_web clasess. I'll keep looking, but seems that this might be a bug?

grant-traynor commented 4 months ago

Should mention that this compiles and runs as expected on Android and Apple iOS.

NashdaDash commented 4 months ago

I have the same compile problem for the web too after upgrade the firebase_ui_oauth_google to ^1.3.0 version. You can solve the problem by downgrade the package by editing the pubspec.yaml and replace firebase_ui_oauth_google: 1.3.0 with firebase_ui_oauth_google: 1.2.17 This should solve your problem for now.

garv-shah commented 4 months ago

Currently also having the same compile problem for the latest release version :)

darshankawar commented 4 months ago

Seeing the same behavior as reported:

dhs@Dhss-MacBook-Pro firebase_ui_auth_example % flutter run -d chrome
Launching lib/main.dart on Chrome in debug mode...
../../../../../.pub-cache/hosted/pub.dev/firebase_ui_oauth_google-1.3.0/lib/src/provider.dart:97:13: Error: Superclass has no method named 'desktopSignIn'.
      super.desktopSignIn(action);
            ^^^^^^^^^^^^^
Waiting for connection from debug service on Chrome...             31.4s
Failed to compile application.
dhs@Dhss-MacBook-Pro firebase_ui_auth_example % 
Patrick386 commented 4 months ago

flutter web: Even after clearing the cache and changing the version to 1.2.27, the issue still persists.

Screenshot 2024-02-08 at 11 35 28 PM
Patrick386 commented 4 months ago

It is required by another package that needs version 1.3.0, so it keeps getting reinstalled. Which package is associated with this requirement for version 1.3.0?

kl3mousse commented 4 months ago

It is required by another package that needs version 1.3.0, so it keeps getting reinstalled. Which package is associated with this requirement for version 1.3.0?

I faced the same issue. I finally forced the version in pubspec.yaml by removing the ^ firebase_ui_oauth_google: 1.2.17 not ideal, but it works for now.

Patrick386 commented 4 months ago

It is required by another package that needs version 1.3.0, so it keeps getting reinstalled. Which package is associated with this requirement for version 1.3.0?

I faced the same issue. I finally forced the version in pubspec.yaml by removing the ^ firebase_ui_oauth_google: 1.2.17 not ideal, but it works for now.

In my case, even when I downgrade the version, 1.3.0 is newly installed. I tried removing packages that seem to be related, but it didn't help.

https://github.com/firebase/FirebaseUI-Flutter/assets/49754877/0571d34a-6567-4348-bd14-289ab9a2c6d0

NashdaDash commented 4 months ago

@Patrick386 you need to remove '^' Infront the version number. the '^' symbol tell the pubspec.yaml to use package version 1.2.17 or Latest. that why it keep installed the latest package.

use firebase_ui_oauth_google: 1.2.17 without the symbol

Patrick386 commented 4 months ago

@Patrick386 you need to remove '^' Infront the version number. the '^' symbol tell the pubspec.yaml to use package version 1.2.17 or Latest. that why it keep installed the latest package.

use firebase_ui_oauth_google: 1.2.17 without the symbol

Thank you. I forgot to remove the '^'. I was able to roll back successfully.

geminiyellow commented 4 months ago

i downgrade it to 1.2.17, but on -d macos, it throw this redirect_uri_mismatch error

levelUpJosh commented 4 months ago

Just adding that I had to do the same and downgrade to 1.2.17

darshankawar commented 4 months ago

/cc @lesnitsky

Hideiuke commented 4 months ago

Just adding that I had to do the same and downgrade to 1.2.17

metoo