firebase / FirebaseUI-Flutter

Apache License 2.0
99 stars 86 forks source link

🐛 [firebase_ui_auth] Google & Twitter sign-in throws unkown error #12

Open khanliKU opened 1 year ago

khanliKU commented 1 year ago

Bug report

Describe the bug Trying to sign in using Google or Twitter throws an unknown error.

Screenshot_20230613-172026

Steps to reproduce

Steps to reproduce the behavior:

  1. Run the example in the package.
  2. click either google or twitter sign-in
  3. choose an account
  4. See error or incorrect behavior

Expected behavior

I expect it to succeed

Sample project

Use the sample inside the package


Additional context

I tried the same in my app with my keys and secrets. I decided to try the example app, and it doesn't even work...


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` [√] Flutter (Channel stable, 3.10.4, on Microsoft Windows [Version 10.0.22621.1702], locale en-US) [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.3) [√] Android Studio (version 2022.2) [√] VS Code (version 1.79.0) [√] Connected device (4 available) [√] Network resources • No issues found! ```

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` Dart SDK 3.0.3 Flutter SDK 3.10.4 firebase_ui_auth_example 1.0.0+1 dependencies: - cupertino_icons 1.0.5 - firebase_auth 4.6.2 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 2.13.1 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_ui_auth 1.4.2 [email_validator firebase_auth firebase_core firebase_dynamic_links firebase_ui_localizations firebase_ui_oauth firebase_ui_shared flutter flutter_localizations] - firebase_ui_localizations 1.5.0 [flutter flutter_localizations path] - firebase_ui_oauth 1.4.2 [desktop_webview_auth firebase_auth firebase_ui_auth firebase_ui_shared flutter_svg flutter] - firebase_ui_oauth_apple 1.2.2 [firebase_auth firebase_ui_oauth flutter] - firebase_ui_oauth_facebook 1.2.2 [firebase_auth firebase_ui_oauth flutter flutter_facebook_auth] - firebase_ui_oauth_google 1.2.2 [firebase_auth firebase_ui_oauth flutter google_sign_in] - firebase_ui_oauth_twitter 1.2.2 [flutter firebase_auth firebase_ui_oauth twitter_login] - flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine] - flutter_localizations 0.0.0 [flutter intl characters clock collection js material_color_utilities meta path vector_math] dev dependencies: - drive 1.0.0-1.0.nullsafety.5 [test_api flutter_test flutter_driver stack_trace flutter] - firebase_ui_shared 1.3.0 [flutter] - flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver async boolean_selector characters clock collection js matcher material_color_utilities platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api vector_math] - flutter_facebook_auth 5.0.11 [flutter flutter_facebook_auth_platform_interface flutter_facebook_auth_web facebook_auth_desktop] - flutter_lints 2.0.1 [lints] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection js matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph] - google_sign_in 6.1.4 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web] - http 0.13.6 [async http_parser meta] - integration_test 0.0.0 [flutter flutter_driver flutter_test path vm_service async boolean_selector characters clock collection fake_async file js matcher material_color_utilities meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api vector_math webdriver] - mockito 5.4.2 [analyzer build code_builder collection dart_style matcher meta path source_gen test_api] - test 1.24.1 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core matcher] - twitter_login 4.4.0 [crypto flutter http] dependency overrides: - _flutterfire_internals 1.3.2 [collection firebase_core firebase_core_platform_interface flutter meta] - firebase_auth 4.6.2 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_auth_platform_interface 6.15.2 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.5.2 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser js meta] - firebase_core 2.13.1 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_core_platform_interface 4.8.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.5.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_dynamic_links 5.3.2 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface] - firebase_dynamic_links_platform_interface 0.2.6+2 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_ui_auth 1.4.2 [email_validator firebase_auth firebase_core firebase_dynamic_links firebase_ui_localizations firebase_ui_oauth firebase_ui_shared flutter flutter_localizations] - firebase_ui_localizations 1.5.0 [flutter flutter_localizations path] - firebase_ui_oauth 1.4.2 [desktop_webview_auth firebase_auth firebase_ui_auth firebase_ui_shared flutter_svg flutter] - firebase_ui_oauth_apple 1.2.2 [firebase_auth firebase_ui_oauth flutter] - firebase_ui_oauth_facebook 1.2.2 [firebase_auth firebase_ui_oauth flutter flutter_facebook_auth] - firebase_ui_oauth_google 1.2.2 [firebase_auth firebase_ui_oauth flutter google_sign_in] - firebase_ui_oauth_twitter 1.2.2 [flutter firebase_auth firebase_ui_oauth twitter_login] - firebase_ui_shared 1.3.0 [flutter] transitive dependencies: - _fe_analyzer_shared 61.0.0 [meta] - analyzer 5.13.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - args 2.4.2 - async 2.11.0 [collection meta] - boolean_selector 2.1.1 [source_span string_scanner] - build 2.4.0 [analyzer async convert crypto glob logging meta package_config path] - built_collection 5.1.1 - built_value 8.6.1 [built_collection collection fixnum meta] - characters 1.3.0 - clock 1.1.1 - code_builder 4.5.0 [built_collection built_value collection matcher meta] - collection 1.17.1 - convert 3.1.1 [typed_data] - coverage 1.6.3 [args logging package_config path source_maps stack_trace vm_service] - crypto 3.0.3 [typed_data] - dart_style 2.3.1 [analyzer args path pub_semver source_span] - desktop_webview_auth 0.0.12 [crypto flutter http flutter_web_plugins plugin_platform_interface] - email_validator 2.1.17 - facebook_auth_desktop 0.0.9 [flutter http flutter_secure_storage flutter_facebook_auth_platform_interface] - fake_async 1.3.1 [clock collection] - file 6.1.4 [meta path] - fixnum 1.1.0 - flutter_facebook_auth_platform_interface 4.1.1 [flutter plugin_platform_interface] - flutter_facebook_auth_web 4.1.1 [flutter flutter_web_plugins js flutter_facebook_auth_platform_interface] - flutter_secure_storage 8.0.0 [flutter flutter_secure_storage_linux flutter_secure_storage_macos flutter_secure_storage_platform_interface flutter_secure_storage_web flutter_secure_storage_windows meta] - flutter_secure_storage_linux 1.1.3 [flutter flutter_secure_storage_platform_interface] - flutter_secure_storage_macos 3.0.0 [flutter flutter_secure_storage_platform_interface] - flutter_secure_storage_platform_interface 1.0.1 [flutter plugin_platform_interface] - flutter_secure_storage_web 1.1.1 [flutter flutter_secure_storage_platform_interface flutter_web_plugins js] - flutter_secure_storage_windows 2.0.0 [flutter flutter_secure_storage_platform_interface] - flutter_svg 2.0.7 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math] - frontend_server_client 3.2.0 [async path] - fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform] - glob 2.1.2 [async collection file path string_scanner] - google_identity_services_web 0.2.1 [js meta] - google_sign_in_android 6.1.16 [flutter google_sign_in_platform_interface] - google_sign_in_ios 5.6.2 [flutter google_sign_in_platform_interface] - google_sign_in_platform_interface 2.4.1 [flutter plugin_platform_interface quiver] - google_sign_in_web 0.12.0+2 [flutter flutter_web_plugins google_identity_services_web google_sign_in_platform_interface http js] - http_multi_server 3.2.1 [async] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - intl 0.18.0 [clock meta path] - io 1.0.4 [meta path string_scanner] - js 0.6.7 [meta] - lints 2.1.1 - logging 1.2.0 - matcher 0.12.15 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.2.0 - meta 1.9.1 - mime 1.0.4 - node_preamble 2.0.2 - package_config 2.1.0 [path] - path 1.8.3 - path_parsing 1.0.1 [vector_math meta] - petitparser 5.4.0 [meta] - platform 3.1.0 - plugin_platform_interface 2.1.4 [meta] - pool 1.5.1 [async stack_trace] - process 4.2.4 [file path platform] - pub_semver 2.1.4 [collection meta] - quiver 3.2.1 [matcher] - shelf 1.4.1 [async collection http_parser path stack_trace stream_channel] - shelf_packages_handler 3.0.2 [path shelf shelf_static] - shelf_static 1.1.2 [convert http_parser mime path shelf] - shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel] - sky_engine 0.0.99 - source_gen 1.3.2 [analyzer async build dart_style glob path source_span yaml] - source_map_stack_trace 2.1.1 [path source_maps stack_trace] - source_maps 0.10.12 [source_span] - source_span 1.9.1 [collection path term_glyph] - stack_trace 1.11.0 [path] - stream_channel 2.1.1 [async] - string_scanner 1.2.0 [source_span] - sync_http 0.3.1 - term_glyph 1.2.1 - test_api 0.5.1 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - test_core 0.5.1 [analyzer async args boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api] - typed_data 1.3.2 [collection] - vector_graphics 1.1.7 [flutter vector_graphics_codec] - vector_graphics_codec 1.1.7 - vector_graphics_compiler 1.1.7 [args meta path_parsing xml vector_graphics_codec] - vector_math 2.1.4 - vm_service 11.3.0 - watcher 1.1.0 [async path] - web_socket_channel 2.4.0 [async crypto stream_channel] - webdriver 3.0.2 [matcher path stack_trace sync_http] - webkit_inspection_protocol 1.2.0 [logging] - xml 6.3.0 [collection meta petitparser] - yaml 3.1.2 [collection source_span string_scanner] ```

darshankawar commented 1 year ago

Thanks for the report. I tried with the plugin example running on Android emulator and although I was able to make google sign in work as below:

Screenshot 2023-06-14 at 3 32 37 PM

But tapping on sign-in with Twitter shows the reported behavior.

Screenshot 2023-06-14 at 3 34 05 PM

I tried with latest plugin version for twitter_login but showing same error.

khanliKU commented 1 year ago

Thank you for your quick response. I tried to run the app on a physical device and an emulator. I got the same error on both devices for both Google and Twitter.

How do you get Google to work on the emulator? Did you do any configuration? Did you just run flutter run?

If a problem in my code causes this, it should report what is going wrong. Instead of returning an unknown error, it should print the reason and stack trace.

khanliKU commented 1 year ago

Is there a way for me to see what is going wrong in Google Cloud Log Explorer?

lesnitsky commented 1 year ago

@khanliKU the google sign in issue is most likely related to the missing SHA fingerprint of the test device (see this for more details).

I will investigate the twitter sign in issue.

nickf2k commented 11 months ago

@lesnitsky i use emulator so SHA fingerprint is not related here. My App was crashed and I got this:

Lost connection to device.
Exception: Unable to terminate org.company.app on xxxxxx
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
The operation couldn’t be completed. found nothing to terminate
found nothing to terminate
  Command: /usr/bin/arch -arm64e xcrun simctl terminate xxxxxx org.company.app
Failed to send request: {"jsonrpc":"2.0","id":"406","method":"getObject","params":{"isolateId":"isolates/1620618165500679","objectId":"libraries/@804348627/scripts/package%3Aflutter%2Fsrc%2Fservices%2Fmessage_codecs.dart/18a9a18f27c"}}
EArminjon commented 9 months ago

Same "an unknown error occurred" on my side. Emulator or real device, prod or debug same output. It works as expected on iOS but not on Android...