firebase / FirebaseUI-Flutter

Apache License 2.0
92 stars 79 forks source link

🐛 [firebase_ui_oauth_google] 'AuthProvider' is imported from both #236

Closed Xerosigma closed 6 months ago

Xerosigma commented 6 months ago

Bug report

Receiving Error 'AuthProvider' is imported from both ... on run when using firebase_ui_oauth_google version ^1.2.10.

Describe the bug When importing firebase_ui_oauth_google: ^1.2.10 I need to use dependency_overrides and force usage of firebase_auth: "4.12.0" to avoid the error.

Steps to reproduce

  1. Clone https://github.com/j1mmyto9/flutter-boilerplate
  2. flutter pub add firebase_ui_oauth_google
  3. Configure Firebase per https://firebase.google.com/codelabs/firebase-auth-in-flutter-apps#2

Expected behavior

I expect provider class names to not clash.

Sample project

TODO


Additional context

N/A


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.13.8, on macOS 13.2.1 22D68 darwin-x64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] IntelliJ IDEA Community Edition (version 2019.3.3) [✓] VS Code (version 1.82.2) [✓] Connected device (2 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.1.4 Flutter SDK 3.13.8 my_app 1.0.0+1 dependencies: - auto_route 6.4.0 [flutter path collection meta] - auto_size_text 3.0.0 [flutter] - bot_toast 4.1.3 [flutter] - cached_network_image 3.3.0 [cached_network_image_platform_interface cached_network_image_web flutter flutter_cache_manager octo_image] - cupertino_icons 1.0.6 - d20 0.3.1+1 [math_expressions] - dart_json_mapper 2.2.9 [analyzer build build_config intl meta path reflectable collection pubspec_parse] - device_info_plus 8.2.2 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32] - environment_config 3.1.0 [dart_style code_builder args yaml] - equatable 2.0.5 [collection meta] - firebase_ui_oauth_google 1.2.10 [firebase_auth firebase_ui_oauth flutter google_sign_in] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine] - flutter_bloc 8.1.3 [bloc flutter provider] - flutter_dotenv 5.1.0 [flutter] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math web] - flutter_slidable 2.0.0 [flutter] - flutter_svg 2.0.9 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler] - formz 0.5.0+1 [meta] - get_it 7.6.4 [async collection] - http 0.13.6 [async http_parser meta] - logger 1.4.0 - modal_bottom_sheet 3.0.0-pre [flutter] - package_info_plus 3.1.2 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface win32] - shared_preferences 2.2.2 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - shimmer 2.0.0 [flutter] - url_launcher 6.2.2 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] dev dependencies: - auto_route_generator 6.2.0 [build source_gen analyzer path build_runner code_builder dart_style xml args glob auto_route] - build_runner 2.4.7 [analyzer args async build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - flutter_lints 2.0.3 [lints] - flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math async boolean_selector characters collection material_color_utilities meta source_span stream_channel string_scanner term_glyph web] dependency overrides: - firebase_auth 4.12.0 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] transitive dependencies: - _fe_analyzer_shared 61.0.0 [meta] - _flutterfire_internals 1.3.16 [collection firebase_core firebase_core_platform_interface flutter 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] - bloc 8.1.2 [meta] - boolean_selector 2.1.1 [source_span string_scanner] - build 2.4.1 [analyzer async convert crypto glob logging meta package_config path] - build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 4.0.1 [built_collection built_value crypto http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.4.2 [analyzer async build collection convert crypto graphs logging package_config path pool pub_semver stream_transform yaml] - build_runner_core 7.2.11 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta package_config path pool timing watcher yaml] - built_collection 5.1.1 - built_value 8.8.1 [built_collection collection fixnum meta] - cached_network_image_platform_interface 3.0.0 [flutter flutter_cache_manager] - cached_network_image_web 1.1.0 [cached_network_image_platform_interface flutter flutter_cache_manager] - characters 1.3.0 - checked_yaml 2.0.3 [json_annotation source_span yaml] - clock 1.1.1 - code_builder 4.9.0 [built_collection built_value collection matcher meta] - collection 1.17.2 - convert 3.1.1 [typed_data] - crypto 3.0.3 [typed_data] - dart_style 2.3.2 [analyzer args path pub_semver source_span] - desktop_webview_auth 0.0.12 [crypto flutter http flutter_web_plugins plugin_platform_interface] - device_info_plus_platform_interface 7.0.0 [flutter meta plugin_platform_interface] - email_validator 2.1.17 - fake_async 1.3.1 [clock collection] - ffi 2.1.0 - file 6.1.4 [meta path] - firebase_auth_platform_interface 7.0.9 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.8.12 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser js meta] - firebase_core 2.24.2 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_core_platform_interface 5.0.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.10.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_dynamic_links 5.4.8 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface] - firebase_dynamic_links_platform_interface 0.2.6+16 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_ui_auth 1.7.0 [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.9.0 [flutter flutter_localizations path] - firebase_ui_oauth 1.4.10 [desktop_webview_auth firebase_auth firebase_ui_auth firebase_ui_shared flutter_svg flutter] - firebase_ui_shared 1.4.1 [flutter] - fixnum 1.1.0 - flutter_cache_manager 3.3.1 [clock collection file flutter http path path_provider rxdart sqflite uuid] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web] - frontend_server_client 3.2.0 [async path] - glob 2.1.2 [async collection file path string_scanner] - google_identity_services_web 0.2.2 [js meta] - google_sign_in 6.1.6 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web] - google_sign_in_android 6.1.20 [flutter google_sign_in_platform_interface] - google_sign_in_ios 5.6.5 [flutter google_sign_in_platform_interface pigeon] - google_sign_in_platform_interface 2.4.3 [flutter plugin_platform_interface] - google_sign_in_web 0.12.2+1 [flutter flutter_web_plugins google_identity_services_web google_sign_in_platform_interface http js] - graphs 2.3.1 [collection] - http_multi_server 3.2.1 [async] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - intl 0.18.1 [clock meta path] - io 1.0.4 [meta path string_scanner] - js 0.6.7 [meta] - json_annotation 4.8.1 [meta] - lints 2.1.1 - logging 1.2.0 - matcher 0.12.16 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.5.0 [collection] - math_expressions 2.4.0 [vector_math] - meta 1.9.1 - mime 1.0.4 - nested 1.0.0 [flutter] - octo_image 2.0.0 [flutter] - package_config 2.1.0 [path] - package_info_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - path 1.8.3 - path_parsing 1.0.1 [vector_math meta] - path_provider 2.1.1 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - path_provider_android 2.2.2 [flutter path_provider_platform_interface] - path_provider_foundation 2.3.1 [flutter path_provider_platform_interface] - path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.1.1 [flutter platform plugin_platform_interface] - path_provider_windows 2.2.1 [ffi flutter path path_provider_platform_interface win32] - petitparser 5.4.0 [meta] - pigeon 11.0.1 [analyzer args collection meta path yaml] - platform 3.1.3 - plugin_platform_interface 2.1.7 [meta] - pool 1.5.1 [async stack_trace] - provider 6.1.1 [collection flutter nested] - pub_semver 2.1.4 [collection meta] - pubspec_parse 1.2.3 [checked_yaml collection json_annotation pub_semver yaml] - reflectable 4.0.5 [analyzer build build_resolvers build_config build_runner build_runner_core dart_style glob logging package_config path source_span] - rxdart 0.27.7 - shared_preferences_android 2.2.1 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.3.4 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.3.2 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.3.1 [flutter plugin_platform_interface] - shared_preferences_web 2.2.1 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.3.2 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - shelf 1.4.1 [async collection http_parser path stack_trace stream_channel] - shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel] - sky_engine 0.0.99 - source_gen 1.5.0 [analyzer async build dart_style glob path source_span yaml] - source_span 1.10.0 [collection path term_glyph] - sprintf 7.0.0 - sqflite 2.3.0 [flutter sqflite_common path] - sqflite_common 2.5.0+2 [synchronized path meta] - stack_trace 1.11.0 [path] - stream_channel 2.1.1 [async] - stream_transform 2.1.0 - string_scanner 1.2.0 [source_span] - synchronized 3.1.0+1 - term_glyph 1.2.1 - test_api 0.6.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - timing 1.0.1 [json_annotation] - typed_data 1.3.2 [collection] - url_launcher_android 6.2.0 [flutter url_launcher_platform_interface] - url_launcher_ios 6.2.1 [flutter url_launcher_platform_interface] - url_launcher_linux 3.1.1 [flutter url_launcher_platform_interface] - url_launcher_macos 3.1.0 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.2.0 [flutter plugin_platform_interface] - url_launcher_web 2.2.0 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.1.1 [flutter url_launcher_platform_interface] - uuid 4.2.2 [crypto sprintf meta] - vector_graphics 1.1.9+1 [flutter vector_graphics_codec] - vector_graphics_codec 1.1.9+1 - vector_graphics_compiler 1.1.9+1 [args meta path_parsing xml vector_graphics_codec path] - vector_math 2.1.4 - watcher 1.1.0 [async path] - web 0.1.4-beta - web_socket_channel 2.4.0 [async crypto stream_channel] - win32 4.1.4 [ffi] - xdg_directories 1.0.3 [meta path] - xml 6.3.0 [collection meta petitparser] - yaml 3.1.2 [collection source_span string_scanner] ```

russellwheatley commented 6 months ago

We now export AuthProvider from firebase_auth: https://github.com/firebase/flutterfire/pull/11470

I think this should be resoloved at the firebase-ui-flutter repository which depends on firebase_auth: https://github.com/firebase/FirebaseUI-Flutter

danagbemava-nc commented 6 months ago

Transferring to firebase_ui

danagbemava-nc commented 6 months ago

Hi @Xerosigma, where is AuthProvider used in your app? I followed the steps you outlined above but I do not get the error when I run the app. What platform(s) do you see this issue on?

lesnitsky commented 6 months ago

There's nothing from firebase_ui except a renaming of AuthProvider to something else which would be a breaking change without much value.

There's several ways of dealing with name conflicts, such as:

import 'package:firebase_auth/firebase_auth.dart' hide AuthProivder;

or

import 'package:firebase_auth/firebase_auth.dart' as fba;

or

import 'package:firebase_auth/firebase_auth.dart' show EmailAuthProvider;
EthanIsaac commented 4 months ago

Hello! I'm getting the same error again. I even removed the firebase_auth dependency from my project, and only adding firebase_auth_ui throws this error.

It seems that firebase_auth_ui is importing AuthProvider both from local and from firebase_auth_platform_interface which is causing the conflict.

../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/auth_flow.dart:11:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/internal/provider_screen.dart:7:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/firebase_ui_auth.dart:14:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'src/providers/auth_provider.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/navigation/authentication.dart:8:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart:8:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart:8:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/universal_email_sign_in_provider.dart:7:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/different_method_sign_in_dialog.dart:8:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/reauthenticate_dialog.dart:8:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/internal/multi_provider_screen.dart:7:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/auth_flow.dart:49:9: Error: The return type of the method 'AuthFlow.provider' is 'T', which does not match the return type, 'AuthProvider<AuthListener, AuthCredential>', of the overridden method, 'AuthListener.provider'.

  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart'). Change to a subtype of 'AuthProvider<AuthListener, AuthCredential>'. T get provider => _provider..authListener = this; ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart:45:20: Context: This is the overridden method ('provider'). AuthProvider get provider; ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/flows/email_link_flow.dart:33:7: Error: Class 'EmailLinkFlow' inherits multiple members named 'provider' with incompatible signatures. Try adding a declaration of 'provider' to 'EmailLinkFlow'. class EmailLinkFlow extends AuthFlow ^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/auth_flow.dart:49:9: Context: This is one of the overridden members. T get provider => _provider..authListener = this; ^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart:45:20: Context: This is one of the overridden members. AuthProvider get provider; ^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/flows/phone_auth_flow.dart:96:7: Error: Class 'PhoneAuthFlow' inherits multiple members named 'provider' with incompatible signatures. Try adding a declaration of 'provider' to 'PhoneAuthFlow'. class PhoneAuthFlow extends AuthFlow ^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/auth_flow.dart:49:9: Context: This is one of the overridden members. T get provider => _provider..authListener = this; ^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart:45:20: Context: This is one of the overridden members. AuthProvider get provider; ^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/flows/universal_email_sign_in_flow.dart:23:7: Error: Class 'UniversalEmailSignInFlow' inherits multiple members named 'provider' with incompatible signatures. Try adding a declaration of 'provider' to 'UniversalEmailSignInFlow'. class UniversalEmailSignInFlow extends AuthFlow ^^^^^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/auth_flow.dart:49:9: Context: This is one of the overridden members. T get provider => _provider..authListener = this; ^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart:45:20: Context: This is one of the overridden members. AuthProvider get provider; ^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/auth_flow.dart:163:26: Error: The argument type 'T' can't be assigned to the parameter type 'AuthProvider<AuthListener, AuthCredential>' because 'T' is nullable and 'AuthProvider<AuthListener, AuthCredential>' isn't.
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart'). defaultOnAuthError(provider, error); ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/flows/phone_auth_flow.dart:165:14: Error: The method 'onCredentialReceived' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing method, or defining a method named 'onCredentialReceived'. provider.onCredentialReceived(credential, action); ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/flows/universal_email_sign_in_flow.dart:44:14: Error: The method 'findProvidersForEmail' isn't defined for the class 'UniversalEmailSignInProvider'.
  • 'UniversalEmailSignInProvider' is from 'package:firebase_ui_auth/src/providers/universal_email_sign_in_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/universal_email_sign_in_provider.dart'). Try correcting the name to the name of an existing method, or defining a method named 'findProvidersForEmail'. provider.findProvidersForEmail(email); ^^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/mfa.dart:49:12: Error: The setter 'auth' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing setter, or defining a setter or field named 'auth'. provider.auth = auth ?? FirebaseAuth.instance; ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart:54:20: Error: The getter 'auth' isn't defined for the class 'EmailLinkAuthProvider'.
  • 'EmailLinkAuthProvider' is from 'package:firebase_ui_auth/src/providers/email_link_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. final future = auth.sendSignInLinkToEmail( ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart:67:9: Error: The getter 'auth' isn't defined for the class 'EmailLinkAuthProvider'.
  • 'EmailLinkAuthProvider' is from 'package:firebase_ui_auth/src/providers/email_link_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. if (auth.isSignInWithEmailLink(link)) { ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart:89:5: Error: The getter 'auth' isn't defined for the class 'EmailLinkAuthProvider'.
  • 'EmailLinkAuthProvider' is from 'package:firebase_ui_auth/src/providers/email_link_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. auth ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart:75:5: Error: The getter 'auth' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. auth.verifyPhoneNumber( ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart:102:7: Error: The method 'onCredentialReceived' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing method, or defining a method named 'onCredentialReceived'. onCredentialReceived(credential, action); ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart:118:52: Error: The getter 'auth' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. bool shouldLink = action == AuthAction.link || auth.currentUser != null; ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart:121:16: Error: The getter 'auth' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. result = auth.currentUser!.linkWithPhoneNumber(phoneNumber); ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart:123:16: Error: The getter 'auth' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. result = auth.signInWithPhoneNumber(phoneNumber); ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/profile_screen.dart:745:61: Error: The getter 'providerId' isn't defined for the class 'Object?'.
  • 'Object' is from 'dart:core'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'providerId'. .where((provider) => user.isProviderLinked(provider.providerId)) ^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/profile_screen.dart:755:47: Error: The getter 'providerId' isn't defined for the class 'Object?'.
  • 'Object' is from 'dart:core'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'providerId'. !user.isProviderLinked(provider.providerId) && ^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/profile_screen.dart:756:24: Error: The method 'supportsPlatform' isn't defined for the class 'Object?'.
  • 'Object' is from 'dart:core'. Try correcting the name to the name of an existing method, or defining a method named 'supportsPlatform'. provider.supportsPlatform(platform), ^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/universal_email_sign_in_screen.dart:68:21: Error: The getter 'providerId' isn't defined for the class 'Object?'.
  • 'Object' is from 'dart:core'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'providerId'. element.providerId: element, ^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/universal_email_sign_in_screen.dart:68:33: Error: A value of type 'Object?' can't be assigned to a variable of type 'AuthProvider<AuthListener, AuthCredential>'.
  • 'Object' is from 'dart:core'.
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart'). element.providerId: element, ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/views/email_link_sign_in_view.dart:51:24: Error: The argument type 'EmailLinkAuthProvider' can't be assigned to the parameter type 'AuthProvider<AuthListener, AuthCredential>?'.
  • 'EmailLinkAuthProvider' is from 'package:firebase_ui_auth/src/providers/email_link_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart').
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart'). provider: widget.provider, ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/views/login_view.dart:238:29: Error: The argument type 'AuthProvider<AuthListener, AuthCredential>' can't be assigned to the parameter type 'EmailLinkAuthProvider'.
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart').
  • 'EmailLinkAuthProvider' is from 'package:firebase_ui_auth/src/providers/email_link_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart'). provider: provider, ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/auth_flow_builder.dart:230:16: Error: A value of type 'PhoneAuthProvider' can't be returned from a function with return type 'AuthProvider<AuthListener, AuthCredential>'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart').
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart'). return PhoneAuthProvider(); ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/auth_flow_builder.dart:232:16: Error: A value of type 'UniversalEmailSignInProvider' can't be returned from a function with return type 'AuthProvider<AuthListener, AuthCredential>'.
  • 'UniversalEmailSignInProvider' is from 'package:firebase_ui_auth/src/providers/universal_email_sign_in_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/universal_email_sign_in_provider.dart').
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart'). return UniversalEmailSignInProvider(); ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/auth_flow_builder.dart:256:19: Error: The argument type 'AuthProvider<AuthListener, AuthCredential>' can't be assigned to the parameter type 'EmailLinkAuthProvider'.
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart').
  • 'EmailLinkAuthProvider' is from 'package:firebase_ui_auth/src/providers/email_link_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart'). provider: provider, ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/auth_flow_builder.dart:267:19: Error: The argument type 'AuthProvider<AuthListener, AuthCredential>' can't be assigned to the parameter type 'PhoneAuthProvider'.
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart').
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). provider: provider, ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/auth_flow_builder.dart:273:19: Error: The argument type 'AuthProvider<AuthListener, AuthCredential>' can't be assigned to the parameter type 'UniversalEmailSignInProvider'.
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart').
  • 'UniversalEmailSignInProvider' is from 'package:firebase_ui_auth/src/providers/universal_email_sign_in_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/universal_email_sign_in_provider.dart'). provider: provider, ^ Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

  • Where: Script '/Users/ethan/developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1151

  • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

    Process 'command '/Users/ethan/developer/flutter/bin/flutter'' finished with non-zero exit value 1

  • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 12s

mmartinez29 commented 1 month ago

Hello! I'm getting the same error again. I even removed the firebase_auth dependency from my project, and only adding firebase_auth_ui throws this error.

It seems that firebase_auth_ui is importing AuthProvider both from local and from firebase_auth_platform_interface which is causing the conflict.

../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/auth_flow.dart:11:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/internal/provider_screen.dart:7:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/firebase_ui_auth.dart:14:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'src/providers/auth_provider.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/navigation/authentication.dart:8:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart:8:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart:8:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/universal_email_sign_in_provider.dart:7:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/different_method_sign_in_dialog.dart:8:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/reauthenticate_dialog.dart:8:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/internal/multi_provider_screen.dart:7:1: Error: 'AuthProvider' is imported from both 'package:firebase_auth_platform_interface/src/auth_provider.dart' and 'package:firebase_ui_auth/src/providers/auth_provider.dart'. import 'package:firebase_ui_auth/firebase_ui_auth.dart'; ^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/auth_flow.dart:49:9: Error: The return type of the method 'AuthFlow.provider' is 'T', which does not match the return type, 'AuthProvider<AuthListener, AuthCredential>', of the overridden method, 'AuthListener.provider'.

  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart'). Change to a subtype of 'AuthProvider<AuthListener, AuthCredential>'. T get provider => _provider..authListener = this; ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart:45:20: Context: This is the overridden method ('provider'). AuthProvider get provider; ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/flows/email_link_flow.dart:33:7: Error: Class 'EmailLinkFlow' inherits multiple members named 'provider' with incompatible signatures. Try adding a declaration of 'provider' to 'EmailLinkFlow'. class EmailLinkFlow extends AuthFlow ^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/auth_flow.dart:49:9: Context: This is one of the overridden members. T get provider => _provider..authListener = this; ^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart:45:20: Context: This is one of the overridden members. AuthProvider get provider; ^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/flows/phone_auth_flow.dart:96:7: Error: Class 'PhoneAuthFlow' inherits multiple members named 'provider' with incompatible signatures. Try adding a declaration of 'provider' to 'PhoneAuthFlow'. class PhoneAuthFlow extends AuthFlow ^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/auth_flow.dart:49:9: Context: This is one of the overridden members. T get provider => _provider..authListener = this; ^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart:45:20: Context: This is one of the overridden members. AuthProvider get provider; ^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/flows/universal_email_sign_in_flow.dart:23:7: Error: Class 'UniversalEmailSignInFlow' inherits multiple members named 'provider' with incompatible signatures. Try adding a declaration of 'provider' to 'UniversalEmailSignInFlow'. class UniversalEmailSignInFlow extends AuthFlow ^^^^^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/auth_flow.dart:49:9: Context: This is one of the overridden members. T get provider => _provider..authListener = this; ^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart:45:20: Context: This is one of the overridden members. AuthProvider get provider; ^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/auth_flow.dart:163:26: Error: The argument type 'T' can't be assigned to the parameter type 'AuthProvider<AuthListener, AuthCredential>' because 'T' is nullable and 'AuthProvider<AuthListener, AuthCredential>' isn't.
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart'). defaultOnAuthError(provider, error); ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/flows/phone_auth_flow.dart:165:14: Error: The method 'onCredentialReceived' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing method, or defining a method named 'onCredentialReceived'. provider.onCredentialReceived(credential, action); ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/flows/universal_email_sign_in_flow.dart:44:14: Error: The method 'findProvidersForEmail' isn't defined for the class 'UniversalEmailSignInProvider'.
  • 'UniversalEmailSignInProvider' is from 'package:firebase_ui_auth/src/providers/universal_email_sign_in_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/universal_email_sign_in_provider.dart'). Try correcting the name to the name of an existing method, or defining a method named 'findProvidersForEmail'. provider.findProvidersForEmail(email); ^^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/mfa.dart:49:12: Error: The setter 'auth' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing setter, or defining a setter or field named 'auth'. provider.auth = auth ?? FirebaseAuth.instance; ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart:54:20: Error: The getter 'auth' isn't defined for the class 'EmailLinkAuthProvider'.
  • 'EmailLinkAuthProvider' is from 'package:firebase_ui_auth/src/providers/email_link_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. final future = auth.sendSignInLinkToEmail( ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart:67:9: Error: The getter 'auth' isn't defined for the class 'EmailLinkAuthProvider'.
  • 'EmailLinkAuthProvider' is from 'package:firebase_ui_auth/src/providers/email_link_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. if (auth.isSignInWithEmailLink(link)) { ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart:89:5: Error: The getter 'auth' isn't defined for the class 'EmailLinkAuthProvider'.
  • 'EmailLinkAuthProvider' is from 'package:firebase_ui_auth/src/providers/email_link_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. auth ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart:75:5: Error: The getter 'auth' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. auth.verifyPhoneNumber( ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart:102:7: Error: The method 'onCredentialReceived' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing method, or defining a method named 'onCredentialReceived'. onCredentialReceived(credential, action); ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart:118:52: Error: The getter 'auth' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. bool shouldLink = action == AuthAction.link || auth.currentUser != null; ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart:121:16: Error: The getter 'auth' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. result = auth.currentUser!.linkWithPhoneNumber(phoneNumber); ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart:123:16: Error: The getter 'auth' isn't defined for the class 'PhoneAuthProvider'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'auth'. result = auth.signInWithPhoneNumber(phoneNumber); ^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/profile_screen.dart:745:61: Error: The getter 'providerId' isn't defined for the class 'Object?'.
  • 'Object' is from 'dart:core'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'providerId'. .where((provider) => user.isProviderLinked(provider.providerId)) ^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/profile_screen.dart:755:47: Error: The getter 'providerId' isn't defined for the class 'Object?'.
  • 'Object' is from 'dart:core'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'providerId'. !user.isProviderLinked(provider.providerId) && ^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/profile_screen.dart:756:24: Error: The method 'supportsPlatform' isn't defined for the class 'Object?'.
  • 'Object' is from 'dart:core'. Try correcting the name to the name of an existing method, or defining a method named 'supportsPlatform'. provider.supportsPlatform(platform), ^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/universal_email_sign_in_screen.dart:68:21: Error: The getter 'providerId' isn't defined for the class 'Object?'.
  • 'Object' is from 'dart:core'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'providerId'. element.providerId: element, ^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/screens/universal_email_sign_in_screen.dart:68:33: Error: A value of type 'Object?' can't be assigned to a variable of type 'AuthProvider<AuthListener, AuthCredential>'.
  • 'Object' is from 'dart:core'.
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart'). element.providerId: element, ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/views/email_link_sign_in_view.dart:51:24: Error: The argument type 'EmailLinkAuthProvider' can't be assigned to the parameter type 'AuthProvider<AuthListener, AuthCredential>?'.
  • 'EmailLinkAuthProvider' is from 'package:firebase_ui_auth/src/providers/email_link_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart').
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart'). provider: widget.provider, ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/views/login_view.dart:238:29: Error: The argument type 'AuthProvider<AuthListener, AuthCredential>' can't be assigned to the parameter type 'EmailLinkAuthProvider'.
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart').
  • 'EmailLinkAuthProvider' is from 'package:firebase_ui_auth/src/providers/email_link_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart'). provider: provider, ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/auth_flow_builder.dart:230:16: Error: A value of type 'PhoneAuthProvider' can't be returned from a function with return type 'AuthProvider<AuthListener, AuthCredential>'.
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart').
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart'). return PhoneAuthProvider(); ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/auth_flow_builder.dart:232:16: Error: A value of type 'UniversalEmailSignInProvider' can't be returned from a function with return type 'AuthProvider<AuthListener, AuthCredential>'.
  • 'UniversalEmailSignInProvider' is from 'package:firebase_ui_auth/src/providers/universal_email_sign_in_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/universal_email_sign_in_provider.dart').
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart'). return UniversalEmailSignInProvider(); ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/auth_flow_builder.dart:256:19: Error: The argument type 'AuthProvider<AuthListener, AuthCredential>' can't be assigned to the parameter type 'EmailLinkAuthProvider'.
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart').
  • 'EmailLinkAuthProvider' is from 'package:firebase_ui_auth/src/providers/email_link_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/email_link_auth_provider.dart'). provider: provider, ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/auth_flow_builder.dart:267:19: Error: The argument type 'AuthProvider<AuthListener, AuthCredential>' can't be assigned to the parameter type 'PhoneAuthProvider'.
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart').
  • 'PhoneAuthProvider' is from 'package:firebase_ui_auth/src/providers/phone_auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/phone_auth_provider.dart'). provider: provider, ^ ../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/widgets/auth_flow_builder.dart:273:19: Error: The argument type 'AuthProvider<AuthListener, AuthCredential>' can't be assigned to the parameter type 'UniversalEmailSignInProvider'.
  • 'AuthProvider' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthListener' is from 'package:firebase_ui_auth/src/providers/auth_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/auth_provider.dart').
  • 'AuthCredential' is from 'package:firebase_auth_platform_interface/src/auth_credential.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-7.0.9/lib/src/auth_credential.dart').
  • 'UniversalEmailSignInProvider' is from 'package:firebase_ui_auth/src/providers/universal_email_sign_in_provider.dart' ('../../../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.7.0/lib/src/providers/universal_email_sign_in_provider.dart'). provider: provider, ^ Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

  • Where: Script '/Users/ethan/developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1151
  • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command '/Users/ethan/developer/flutter/bin/flutter'' finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

BUILD FAILED in 12s

Getting this same issue. Your solution did not work

frameartist commented 1 month ago

I had this issue but I solved it by updating the dependencies. Turns out I haven't upgrade the packages for a long time and my firebase_ui_auth was version 1.4.0. and my environment was set to sdk: ">=2.17.6 <3.0.0". I updated them and with the newest version of firebase_ui_auth the problem no longer exists.