firebase / FirebaseUI-Flutter

Apache License 2.0
105 stars 94 forks source link

🐛 [firebase_ui_oauth_google] iOS app crashes when I click the "Sign in with Google" button #380

Closed davidianstyle closed 1 month ago

davidianstyle commented 1 month ago

Is there an existing issue for this?

What plugin is this bug for?

Firebase UI Auth, Firebase UI OAuth Google

What platform(s) does this bug affect?

iOS

List of dependencies used.

flutter pub deps -s list
Dart SDK 3.5.0
Flutter SDK 3.24.0
mobile_app_member 0.0.1+1

dependencies:
- flutter 0.0.0
  - characters 1.3.0
  - collection 1.18.0
  - material_color_utilities 0.11.1
  - meta 1.15.0
  - vector_math 2.1.4
  - sky_engine any
- english_words 4.0.0
  - string_scanner ^1.1.0
- provider 6.1.2
  - collection ^1.15.0
  - flutter any
  - nested ^1.0.0
- http 1.2.2
  - async ^2.5.0
  - http_parser ^4.0.0
  - meta ^1.3.0
  - web >=0.5.0 <2.0.0
- intl 0.19.0
  - clock ^1.1.0
  - meta ^1.0.2
  - path ^1.8.0
- flutter_riverpod 2.5.1
  - collection ^1.15.0
  - flutter any
  - meta ^1.4.0
  - riverpod 2.5.1
  - state_notifier >=0.7.2 <2.0.0
- riverpod_annotation 2.3.5
  - meta ^1.7.0
  - riverpod 2.5.1
- firebase_core 3.3.0
  - firebase_core_platform_interface ^5.2.0
  - firebase_core_web ^2.17.4
  - flutter any
  - meta ^1.8.0
- firebase_auth 5.1.4
  - firebase_auth_platform_interface ^7.4.3
  - firebase_auth_web ^5.12.5
  - firebase_core ^3.3.0
  - firebase_core_platform_interface ^5.2.0
  - flutter any
  - meta ^1.8.0
- firebase_ui_auth 1.15.0
  - email_validator ^2.1.17
  - firebase_auth ^5.0.0
  - firebase_core ^3.0.0
  - firebase_dynamic_links ^6.0.0
  - firebase_ui_localizations ^1.12.0
  - firebase_ui_oauth ^1.5.3
  - firebase_ui_shared ^1.4.1
  - flutter any
  - flutter_localizations any
  - meta ^1.10.0
- 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
- firebase_ui_oauth_google 1.3.3
  - firebase_auth ^5.0.0
  - firebase_ui_oauth ^1.5.3
  - flutter any
  - google_sign_in ^6.2.1

dev dependencies:
- flutter_test 0.0.0
  - flutter any
  - test_api 0.7.2
  - matcher 0.12.16+1
  - path 1.9.0
  - fake_async 1.3.1
  - clock 1.1.1
  - stack_trace 1.11.1
  - vector_math 2.1.4
  - leak_tracker_flutter_testing 3.0.5
  - async 2.11.0
  - boolean_selector 2.1.1
  - characters 1.3.0
  - collection 1.18.0
  - leak_tracker 10.0.5
  - leak_tracker_testing 3.0.1
  - material_color_utilities 0.11.1
  - meta 1.15.0
  - source_span 1.10.0
  - stream_channel 2.1.2
  - string_scanner 1.2.0
  - term_glyph 1.2.1
  - vm_service 14.2.4
- flutter_lints 4.0.0
  - lints ^4.0.0
- riverpod_generator 2.4.2
  - analyzer ^6.5.0
  - build ^2.0.0
  - build_config ^1.0.0
  - collection ^1.15.0
  - crypto ^3.0.2
  - meta ^1.7.0
  - path ^1.8.0
  - riverpod_analyzer_utils ^0.5.3
  - riverpod_annotation ^2.3.5
  - source_gen ^1.2.0
- custom_lint 0.6.4
  - analyzer >=5.12.0 <7.0.0
  - analyzer_plugin ^0.11.0
  - args ^2.3.1
  - async ^2.9.0
  - ci ^0.1.0
  - cli_util ^0.4.0
  - collection ^1.16.0
  - custom_lint_core 0.6.3
  - freezed_annotation ^2.2.0
  - json_annotation ^4.7.0
  - meta ^1.7.0
  - package_config ^2.0.2
  - path ^1.8.0
  - pub_semver ^2.1.1
  - pubspec_parse ^1.2.0
  - rxdart ^0.27.7
  - uuid >=3.0.6 <5.0.0
  - yaml ^3.1.1
- riverpod_lint 2.3.12
  - analyzer ^6.5.0
  - analyzer_plugin ^0.11.2
  - collection ^1.16.0
  - custom_lint_builder ^0.6.0
  - meta ^1.7.0
  - path ^1.8.1
  - riverpod ^2.5.1
  - riverpod_analyzer_utils ^0.5.3
  - source_span ^1.8.0
  - yaml ^3.1.1
- build_runner 2.4.12
  - analyzer >=4.4.0 <7.0.0
  - args ^2.0.0
  - async ^2.5.0
  - build >=2.1.0 <2.5.0
  - build_config >=1.1.0 <1.2.0
  - build_daemon ^4.0.0
  - build_resolvers ^2.0.0
  - build_runner_core ^7.2.0
  - code_builder ^4.2.0
  - collection ^1.15.0
  - crypto ^3.0.0
  - dart_style ^2.0.0
  - frontend_server_client >=3.0.0 <5.0.0
  - glob ^2.0.0
  - graphs ^2.2.0
  - http_multi_server ^3.0.0
  - io ^1.0.0
  - js >=0.6.3 <0.8.0
  - logging ^1.0.0
  - meta ^1.3.0
  - mime ^1.0.0
  - package_config ^2.0.0
  - path ^1.8.0
  - pool ^1.5.0
  - pub_semver ^2.0.0
  - pubspec_parse ^1.0.0
  - shelf ^1.0.0
  - shelf_web_socket >=1.0.0 <3.0.0
  - stack_trace ^1.10.0
  - stream_transform ^2.0.0
  - timing ^1.0.0
  - watcher ^1.0.0
  - web_socket_channel >=2.0.0 <4.0.0
  - yaml ^3.0.0

transitive dependencies:
- _fe_analyzer_shared 72.0.0
  - meta ^1.9.0
- _flutterfire_internals 1.3.40
  - collection ^1.0.0
  - firebase_core ^3.3.0
  - firebase_core_platform_interface ^5.2.0
  - flutter any
  - meta ^1.8.0
- _macros 0.3.2
- analyzer 6.7.0
  - _fe_analyzer_shared ^72.0.0
  - collection ^1.17.0
  - convert ^3.0.0
  - crypto ^3.0.0
  - glob ^2.0.0
  - macros >=0.1.2-main.3 <0.1.3
  - meta ^1.15.0
  - package_config ^2.0.0
  - path ^1.9.0
  - pub_semver ^2.1.4
  - source_span ^1.8.0
  - watcher ^1.1.0
  - yaml ^3.0.0
- analyzer_plugin 0.11.3
  - analyzer ^6.0.0
  - collection ^1.15.0
  - dart_style ^2.2.1
  - pub_semver ^2.1.0
  - yaml ^3.1.0
- args 2.5.0
- 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 2.4.1
  - analyzer >=1.5.0 <7.0.0
  - async ^2.5.0
  - convert ^3.0.0
  - crypto ^3.0.0
  - glob ^2.0.0
  - logging ^1.0.0
  - meta ^1.3.0
  - package_config ^2.1.0
  - path ^1.8.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
- build_daemon 4.0.2
  - built_collection ^5.0.0
  - built_value ^8.1.0
  - crypto ^3.0.3
  - http_multi_server ^3.0.0
  - logging ^1.0.0
  - path ^1.8.0
  - pool ^1.5.0
  - shelf ^1.0.0
  - shelf_web_socket >=1.0.0 <3.0.0
  - stream_transform ^2.0.0
  - watcher ^1.0.0
  - web_socket_channel >=2.0.0 <4.0.0
- build_resolvers 2.4.2
  - analyzer >=5.12.0 <7.0.0
  - async ^2.5.0
  - build ^2.0.0
  - collection ^1.17.0
  - convert ^3.1.1
  - crypto ^3.0.0
  - graphs >=1.0.0 <3.0.0
  - logging ^1.0.0
  - package_config ^2.0.0
  - path ^1.8.0
  - pool ^1.5.0
  - pub_semver ^2.0.0
  - stream_transform ^2.0.0
  - yaml ^3.0.0
- build_runner_core 7.3.2
  - async ^2.5.0
  - build ^2.4.0
  - build_config ^1.0.0
  - build_resolvers ^2.4.0
  - collection ^1.15.0
  - convert ^3.0.0
  - crypto ^3.0.0
  - glob ^2.0.0
  - graphs ^2.0.0
  - json_annotation ^4.8.1
  - logging ^1.2.0
  - meta ^1.3.0
  - package_config ^2.0.0
  - path ^1.8.0
  - pool ^1.5.0
  - timing ^1.0.0
  - watcher ^1.0.0
  - yaml ^3.0.0
- built_collection 5.1.1
- built_value 8.9.2
  - built_collection ^5.0.0
  - collection ^1.15.0
  - fixnum ^1.0.0
  - meta ^1.3.0
- characters 1.3.0
- checked_yaml 2.0.3
  - json_annotation ^4.3.0
  - source_span ^1.8.0
  - yaml ^3.0.0
- ci 0.1.0
- cli_util 0.4.1
  - meta ^1.3.0
  - path ^1.8.0
- clock 1.1.1
- code_builder 4.10.0
  - built_collection ^5.0.0
  - built_value ^8.0.0
  - collection ^1.15.0
  - matcher ^0.12.10
  - meta ^1.3.0
- collection 1.18.0
- convert 3.1.1
  - typed_data ^1.3.0
- crypto 3.0.3
  - typed_data ^1.3.0
- custom_lint_builder 0.6.4
  - analyzer ^6.4.0
  - analyzer_plugin ^0.11.0
  - collection ^1.16.0
  - custom_lint 0.6.4
  - custom_lint_core 0.6.3
  - glob ^2.1.1
  - hotreloader >=3.0.5 <5.0.0
  - meta ^1.7.0
  - package_config ^2.1.0
  - path ^1.8.0
  - pubspec_parse ^1.2.0
  - rxdart ^0.27.7
- custom_lint_core 0.6.3
  - analyzer >=5.12.0 <7.0.0
  - analyzer_plugin ^0.11.0
  - collection ^1.16.0
  - glob ^2.1.2
  - matcher ^0.12.0
  - meta ^1.7.0
  - package_config ^2.1.0
  - path ^1.8.0
  - pubspec_parse ^1.2.2
  - source_span ^1.8.0
  - yaml ^3.1.1
- dart_style 2.3.6
  - analyzer ^6.2.0
  - args >=1.0.0 <3.0.0
  - collection ^1.17.0
  - path ^1.0.0
  - pub_semver >=1.4.4 <3.0.0
  - source_span ^1.4.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
- file 7.0.0
  - meta ^1.9.1
  - path ^1.8.3
- firebase_auth_platform_interface 7.4.3
  - _flutterfire_internals ^1.3.40
  - collection ^1.16.0
  - firebase_core ^3.3.0
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_auth_web 5.12.5
  - firebase_auth_platform_interface ^7.4.3
  - firebase_core ^3.3.0
  - firebase_core_web ^2.17.4
  - flutter any
  - flutter_web_plugins any
  - http_parser ^4.0.0
  - meta ^1.8.0
  - web ^0.5.1
- firebase_core_platform_interface 5.2.0
  - collection ^1.0.0
  - flutter any
  - flutter_test any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_core_web 2.17.4
  - firebase_core_platform_interface ^5.2.0
  - flutter any
  - flutter_web_plugins any
  - meta ^1.8.0
  - web ^0.5.1
- firebase_dynamic_links 6.0.4
  - firebase_core ^3.3.0
  - firebase_core_platform_interface ^5.2.0
  - firebase_dynamic_links_platform_interface ^0.2.6+40
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_dynamic_links_platform_interface 0.2.6+40
  - _flutterfire_internals ^1.3.40
  - firebase_core ^3.3.0
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_ui_localizations 1.12.0
  - flutter any
  - flutter_localizations any
  - path ^1.8.3
- firebase_ui_oauth 1.5.3
  - desktop_webview_auth ^0.0.14
  - firebase_auth ^5.0.0
  - firebase_ui_auth ^1.15.0
  - firebase_ui_shared ^1.4.1
  - flutter_svg ^2.0.9
  - flutter any
- firebase_ui_shared 1.4.1
  - flutter any
- fixnum 1.1.0
- flutter_localizations 0.0.0
  - flutter any
  - intl 0.19.0
  - characters 1.3.0
  - clock 1.1.1
  - collection 1.18.0
  - material_color_utilities 0.11.1
  - meta 1.15.0
  - path 1.9.0
  - vector_math 2.1.4
- flutter_svg 2.0.10+1
  - flutter any
  - http ^1.0.0
  - vector_graphics ^1.1.11
  - vector_graphics_codec ^1.1.11
  - vector_graphics_compiler ^1.1.11
- flutter_web_plugins 0.0.0
  - flutter any
  - characters 1.3.0
  - collection 1.18.0
  - material_color_utilities 0.11.1
  - meta 1.15.0
  - vector_math 2.1.4
- freezed_annotation 2.4.4
  - collection ^1.15.0
  - json_annotation ^4.8.0
  - meta ^1.7.0
- frontend_server_client 4.0.0
  - async ^2.5.0
  - path ^1.8.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.1+4
  - meta ^1.3.0
  - web >=0.5.1 <2.0.0
- google_sign_in_android 6.1.28
  - flutter any
  - google_sign_in_platform_interface ^2.2.0
- google_sign_in_ios 5.7.6
  - 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.4+2
  - flutter any
  - flutter_web_plugins any
  - google_identity_services_web ^0.3.1
  - google_sign_in_platform_interface ^2.4.0
  - http >=0.13.0 <2.0.0
  - web >=0.5.1 <2.0.0
- graphs 2.3.2
  - collection ^1.15.0
- hotreloader 4.2.0
  - collection ^1.15.0
  - logging ^1.0.0
  - path ^1.8.0
  - stream_transform ^2.0.0
  - vm_service >=6.0.1 <15.0.0
  - watcher ^1.1.0
- http_multi_server 3.2.1
  - async ^2.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
- io 1.0.4
  - meta ^1.3.0
  - path ^1.8.0
  - string_scanner ^1.1.0
- js 0.7.1
- json_annotation 4.9.0
  - meta ^1.4.0
- leak_tracker 10.0.5
  - clock ^1.1.1
  - collection ^1.15.0
  - meta ^1.8.0
  - path ^1.8.3
  - vm_service >=11.10.0 <15.0.0
- leak_tracker_flutter_testing 3.0.5
  - flutter any
  - leak_tracker >=10.0.5 <11.0.0
  - leak_tracker_testing >=3.0.1 <4.0.0
  - matcher ^0.12.16
  - meta ^1.8.0
- leak_tracker_testing 3.0.1
  - leak_tracker >=9.0.0 <11.0.0
  - matcher ^0.12.16
  - meta ^1.11.0
- lints 4.0.0
- logging 1.2.0
- macros 0.1.2-main.4
  - _macros 0.3.2
- matcher 0.12.16+1
  - async ^2.10.0
  - meta ^1.8.0
  - stack_trace ^1.10.0
  - term_glyph ^1.2.0
  - test_api >=0.5.0 <0.8.0
- material_color_utilities 0.11.1
  - collection ^1.15.0
- meta 1.15.0
- mime 1.0.5
- nested 1.0.0
  - flutter any
- package_config 2.1.0
  - path ^1.8.0
- path 1.9.0
- path_parsing 1.0.1
  - vector_math ^2.1.0
  - meta ^1.3.0
- petitparser 6.0.2
  - meta ^1.9.0
- plugin_platform_interface 2.1.8
  - meta ^1.3.0
- pool 1.5.1
  - async ^2.5.0
  - stack_trace ^1.10.0
- pub_semver 2.1.4
  - collection ^1.15.0
  - meta ^1.3.0
- pubspec_parse 1.3.0
  - checked_yaml ^2.0.1
  - collection ^1.15.0
  - json_annotation ^4.8.0
  - pub_semver ^2.0.0
  - yaml ^3.0.0
- riverpod 2.5.1
  - collection ^1.18.0
  - meta ^1.9.0
  - stack_trace ^1.10.0
  - state_notifier >=0.7.2 <2.0.0
- riverpod_analyzer_utils 0.5.3
  - analyzer ^6.5.0
  - collection ^1.16.0
  - crypto ^3.0.2
  - custom_lint_core ^0.6.0
  - freezed_annotation ^2.2.0
  - meta ^1.7.0
  - path ^1.8.0
  - source_span ^1.8.0
- rxdart 0.27.7
- shelf 1.4.1
  - async ^2.5.0
  - collection ^1.15.0
  - http_parser ^4.0.0
  - path ^1.8.0
  - stack_trace ^1.10.0
  - stream_channel ^2.1.0
- shelf_web_socket 2.0.0
  - shelf ^1.1.0
  - stream_channel ^2.1.0
  - web_socket_channel >=2.0.0 <4.0.0
- sky_engine 0.0.99
- source_gen 1.5.0
  - analyzer >=5.2.0 <7.0.0
  - async ^2.5.0
  - build ^2.1.0
  - dart_style ^2.0.0
  - glob ^2.0.0
  - path ^1.8.0
  - source_span ^1.8.0
  - yaml ^3.0.0
- source_span 1.10.0
  - collection ^1.15.0
  - path ^1.8.0
  - term_glyph ^1.2.0
- sprintf 7.0.0
- stack_trace 1.11.1
  - path ^1.8.0
- state_notifier 1.0.0
  - meta ^1.1.8
- stream_channel 2.1.2
  - async ^2.5.0
- stream_transform 2.1.0
- string_scanner 1.2.0
  - source_span ^1.8.0
- term_glyph 1.2.1
- test_api 0.7.2
  - async ^2.5.0
  - boolean_selector ^2.1.0
  - collection ^1.15.0
  - meta ^1.14.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
- timing 1.0.1
  - json_annotation ^4.3.0
- typed_data 1.3.2
  - collection ^1.15.0
- uuid 4.4.2
  - crypto ^3.0.0
  - sprintf ^7.0.0
  - meta ^1.10.0
  - fixnum ^1.1.0
- vector_graphics 1.1.11+1
  - flutter any
  - http ^1.0.0
  - vector_graphics_codec 1.1.11+1
- vector_graphics_codec 1.1.11+1
- vector_graphics_compiler 1.1.11+1
  - args ^2.3.0
  - meta ^1.7.0
  - path_parsing ^1.0.1
  - xml ^6.3.0
  - vector_graphics_codec 1.1.11+1
  - path ^1.8.0
- vector_math 2.1.4
- vm_service 14.2.4
- watcher 1.1.0
  - async ^2.5.0
  - path ^1.8.0
- web 0.5.1
- web_socket 0.1.6
  - web >=0.5.0 <2.0.0
- web_socket_channel 3.0.1
  - async ^2.5.0
  - crypto ^3.0.0
  - stream_channel ^2.1.0
  - web >=0.5.0 <2.0.0
  - web_socket ^0.1.5
- 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

Followed this tutorial: Add a user authentication flow to a Flutter app using FirebaseUI

Made it successfully through to Step 7 Multiplatform Google Auth Sign In and carefully followed all steps outlined in "Configure iOS" including:

Expected Behavior

I built a minimal app using the Flutter Firebase Auth tutorial with nothing else added and cannot get "Sign in with Google" to work on iOS. I'd expect clicking the button to start the login flow rather than crash the app.

Actual Behavior

iOS app crashes when I click the "Sign in with Google" button.

Additional Information

https://github.com/user-attachments/assets/0f1911dc-d8e5-4e23-be7a-938fd73c136c

Logs:

task run                                                                                                                                                                                                      ─╯
task: [run] flutter pub get
Resolving dependencies... (1.0s)
Downloading packages...
  _fe_analyzer_shared 72.0.0 (73.0.0 available)
  analyzer 6.7.0 (6.8.0 available)
  collection 1.18.0 (1.19.0 available)
  crypto 3.0.3 (3.0.4 available)
  email_validator 2.1.17 (3.0.0 available)
  http_parser 4.0.2 (4.1.0 available)
  material_color_utilities 0.11.1 (0.12.0 available)
  rxdart 0.27.7 (0.28.0 available)
  shelf 1.4.1 (1.4.2 available)
  string_scanner 1.2.0 (1.3.0 available)
  test_api 0.7.2 (0.7.3 available)
  web 0.5.1 (1.0.0 available)
Got dependencies!
12 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
task: [run] flutter run
Launching lib/main.dart on iPhone 15 Pro Max in debug mode...
Running pod install...                                              7.7s
Running Xcode build...
 └─Compiling, linking and signing...                        12.1s
Xcode build done.                                           76.8s
Syncing files to device iPhone 15 Pro Max...                       258ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

A Dart VM Service on iPhone 15 Pro Max is available at: http://127.0.0.1:59822/5ZJnFzvXri8=/
The Flutter DevTools debugger and profiler on iPhone 15 Pro Max is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:59822/5ZJnFzvXri8=/
Lost connection to device.
davidianstyle commented 1 month ago

Showing my XCode configuration:

https://github.com/user-attachments/assets/f160dd7f-7676-4bb5-a8a7-ba5b9cd1f6ea

davidianstyle commented 1 month ago

Tutorial instructs the user to use the web client ID in auth_gate.dart but it really needs to be the client ID corresponding to the platform that you're running on (in my case, iOS). Changing the client ID to the correct one (in GoogleService-Info.plist) fixed the issue and my app is no longer crashing.

davidianstyle commented 1 month ago

Reported issue in the tutorial to Flutter here: https://github.com/flutter/website/issues/11052