firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.5k stars 3.92k forks source link

🐛 [FIIREBASE_AUTH] Unable to establish connection on channel. Android Platform. #11515

Closed RedFox64 closed 9 months ago

RedFox64 commented 10 months ago

Bug report

I get an error when I want to sign in with Apple on Android Platform.

Screenshot 2023-08-21 at 16 37 19

Stack trace:

Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: [firebase_auth/channel-error] Unable to establish connection on channel.. Error thrown _tapAuthAppleButton().
       at FirebaseAuthHostApi.signInWithCredential(messages.pigeon.dart:1005)
       at MethodChannelFirebaseAuth.signInWithCredential(method_channel_firebase_auth.dart:296)
       at FirebaseAuth.signInWithCredential(firebase_auth.dart:519)
       at AuthProvider.signInFirebaseAndMongoDB(auth_cubit.dart:587)
       at AuthProvider.signInApple(auth_cubit.dart:552)
       at AuthCubit.signInApple(auth_cubit.dart:381)`

Code

    final rawNonce = generateNonce();
    final nonce = sha256ofString(rawNonce);

    final appleCredential = await SignInWithApple.getAppleIDCredential(
      scopes: [
        AppleIDAuthorizationScopes.email,
        AppleIDAuthorizationScopes.fullName,
      ],
      webAuthenticationOptions: WebAuthenticationOptions(
          clientId: "com.########",
          redirectUri: Uri.parse("https://########/sign_in_with_apple_callback")),
      nonce: nonce,
    );

    final OAuthCredential credential = OAuthProvider("apple.com").credential(
      idToken: appleCredential.identityToken,
      rawNonce: rawNonce,
    );

   //I am getting an error at this step
   final UserCredential user = await FirebaseAuth.instance.signInWithCredential(credential);

Additional context

I did flutter clean and deleted pubspec.lock file. It didn't help


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.1, on macOS 13.5 22G74 darwin-arm64, locale en-ME) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1) [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.81.1) [✓] Connected device (3 available) [✓] Network resources ```

Flutter dependencies

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

Click To Expand ``` Dart SDK 3.1.0 Flutter SDK 3.13.1 dependencies: - badges 3.1.1 [flutter] - cached_network_image 3.2.3 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web] - copy_with_extension 5.0.4 [meta] - crypto 3.0.3 [typed_data] - cupertino_icons 1.0.5 - device_info_plus 9.0.3 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32 win32_registry] - enum_to_string 2.0.1 - equatable 2.0.5 [collection meta] - expandable_sliver_list 4.1.1 [flutter] - file_picker 5.3.3 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32] - firebase_analytics 10.4.5 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 4.8.0 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 2.15.1 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 3.3.5 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_messaging 14.6.7 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_storage 11.2.6 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine] - flutter_bloc 8.1.3 [bloc flutter provider] - flutter_cache_manager 3.3.1 [clock collection file flutter http path path_provider rxdart sqflite uuid] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math web] - flutter_slidable 3.0.0 [flutter] - flutter_staggered_animations 1.1.1 [flutter] - flutter_svg 2.0.7 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler] - google_sign_in 6.1.4 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web] - icons_plus 4.0.0 [flutter flutter_svg] - image_cropper 5.0.0 [flutter image_cropper_platform_interface image_cropper_for_web] - image_picker 1.0.2 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_linux image_picker_macos image_picker_platform_interface image_picker_windows] - intl 0.18.1 [clock meta path] - logger 2.0.1 - open_file 3.3.2 [flutter ffi] - path_provider 2.1.0 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - permission_handler 10.4.3 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface] - realm 1.4.0 [flutter args build_cli_annotations collection crypto ffi json_annotation logging meta package_config path pubspec_parse pub_semver realm_common realm_generator tar build_runner http cancellation_token] - rxdart 0.27.7 - share_plus 7.0.2 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi win32] - shared_preferences 2.2.0 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - sign_in_button 3.2.0 [flutter font_awesome_flutter] - sign_in_with_apple 5.0.0 [flutter meta sign_in_with_apple_platform_interface sign_in_with_apple_web] - social_login_buttons 1.0.7 [flutter] - url_launcher 6.1.12 [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: - build_runner 2.4.6 [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] - copy_with_extension_gen 5.0.4 [analyzer build source_gen copy_with_extension meta] - flutter_lints 2.0.2 [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: - logger 2.0.1 transitive dependencies: - _fe_analyzer_shared 61.0.0 [meta] - _flutterfire_internals 1.3.5 [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_cli_annotations 2.1.0 [args meta] - build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 4.0.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.2.1 [analyzer async build collection crypto graphs logging package_config path pool pub_semver stream_transform yaml] - build_runner_core 7.2.10 [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.6.2 [built_collection collection fixnum meta] - cached_network_image_platform_interface 2.0.0 [flutter flutter_cache_manager] - cached_network_image_web 1.0.2 [flutter flutter_cache_manager cached_network_image_platform_interface] - cancellation_token 2.0.1 [meta collection] - characters 1.3.0 - checked_yaml 2.0.3 [json_annotation source_span yaml] - clock 1.1.1 - code_builder 4.5.0 [built_collection built_value collection matcher meta] - collection 1.17.2 - convert 3.1.1 [typed_data] - cross_file 0.3.3+4 [js meta] - dart_style 2.3.2 [analyzer args path pub_semver source_span] - device_info_plus_platform_interface 7.0.0 [flutter meta plugin_platform_interface] - fake_async 1.3.1 [clock collection] - ffi 2.1.0 - file 6.1.4 [meta path] - file_selector_linux 0.9.2 [cross_file file_selector_platform_interface flutter] - file_selector_macos 0.9.3+1 [cross_file file_selector_platform_interface flutter] - file_selector_platform_interface 2.6.0 [cross_file flutter http plugin_platform_interface] - file_selector_windows 0.9.3 [cross_file file_selector_platform_interface flutter] - firebase_analytics_platform_interface 3.6.5 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.4+5 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_auth_platform_interface 6.17.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.7.0 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser js meta] - firebase_core_platform_interface 4.8.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.7.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.6.5 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 4.5.6 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.5.6 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_storage_platform_interface 4.4.5 [collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.6.6 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta] - fixnum 1.1.0 - flutter_blurhash 0.7.0 [flutter] - flutter_plugin_android_lifecycle 2.0.15 [flutter] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web] - font_awesome_flutter 10.5.0 [flutter] - frontend_server_client 3.2.0 [async path] - 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.18 [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+3 [flutter flutter_web_plugins google_identity_services_web google_sign_in_platform_interface http js] - graphs 2.3.1 [collection] - http 1.1.0 [async http_parser meta] - http_multi_server 3.2.1 [async] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image_cropper_for_web 3.0.0 [flutter flutter_web_plugins image_cropper_platform_interface js] - image_cropper_platform_interface 5.0.0 [flutter plugin_platform_interface http] - image_picker_android 0.8.7+4 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 3.0.0 [flutter flutter_web_plugins image_picker_platform_interface mime] - image_picker_ios 0.8.8+1 [flutter image_picker_platform_interface] - image_picker_linux 0.2.1 [file_selector_linux file_selector_platform_interface flutter image_picker_platform_interface] - image_picker_macos 0.2.1 [file_selector_macos file_selector_platform_interface flutter image_picker_platform_interface] - image_picker_platform_interface 2.9.0 [cross_file flutter http plugin_platform_interface] - image_picker_windows 0.2.1 [file_selector_platform_interface file_selector_windows flutter image_picker_platform_interface] - 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] - meta 1.9.1 - mime 1.0.4 - nested 1.0.0 [flutter] - objectid 2.1.0 - octo_image 1.0.2 [flutter flutter_blurhash] - package_config 2.1.0 [path] - path 1.8.3 - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.1.0 [flutter path_provider_platform_interface] - path_provider_foundation 2.3.0 [flutter path_provider_platform_interface] - path_provider_linux 2.2.0 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.1.0 [flutter platform plugin_platform_interface] - path_provider_windows 2.2.0 [ffi flutter path path_provider_platform_interface win32] - permission_handler_android 10.3.3 [flutter permission_handler_platform_interface] - permission_handler_apple 9.1.4 [flutter permission_handler_platform_interface] - permission_handler_platform_interface 3.11.3 [flutter meta plugin_platform_interface] - permission_handler_windows 0.1.3 [flutter permission_handler_platform_interface] - petitparser 5.4.0 [meta] - platform 3.1.1 - plugin_platform_interface 2.1.5 [meta] - pool 1.5.1 [async stack_trace] - provider 6.0.5 [collection flutter nested] - pub_semver 2.1.4 [collection meta] - pubspec_parse 1.2.3 [checked_yaml collection json_annotation pub_semver yaml] - quiver 3.2.1 [matcher] - realm_common 1.4.0 [objectid sane_uuid] - realm_generator 1.4.0 [analyzer build_resolvers build dart_style realm_common source_gen source_span] - sane_uuid 1.0.0-alpha.4 [meta crypto] - share_plus_platform_interface 3.3.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid] - shared_preferences_android 2.2.0 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.3.3 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.3.0 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.3.0 [flutter plugin_platform_interface] - shared_preferences_web 2.2.0 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.3.0 [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] - sign_in_with_apple_platform_interface 1.0.0 [flutter plugin_platform_interface meta] - sign_in_with_apple_web 1.0.1 [flutter flutter_web_plugins sign_in_with_apple_platform_interface js] - sky_engine 0.0.99 - source_gen 1.4.0 [analyzer async build dart_style glob path source_span yaml] - source_span 1.10.0 [collection path term_glyph] - sqflite 2.3.0 [flutter sqflite_common path] - sqflite_common 2.5.0 [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 - tar 0.5.6 [async meta typed_data] - 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.0.38 [flutter url_launcher_platform_interface] - url_launcher_ios 6.1.4 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.5 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.6 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.3 [flutter plugin_platform_interface] - url_launcher_web 2.0.18 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.7 [flutter url_launcher_platform_interface] - uuid 3.0.7 [crypto] - 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 - watcher 1.1.0 [async path] - web 0.1.4-beta - web_socket_channel 2.4.0 [async crypto stream_channel] - win32 5.0.7 [ffi] - win32_registry 1.1.1 [ffi win32] - xdg_directories 1.0.2 [meta path] - xml 6.3.0 [collection meta petitparser] - yaml 3.1.2 [collection source_span string_scanner] ```

danagbemava-nc commented 10 months ago

Hi @RedFox64, please provide a complete sample in repo that we can clone so that we can investigate this issue.

Thank you

RedFox64 commented 10 months ago

Hi @RedFox64, please provide a complete sample in repo that we can clone so that we can investigate this issue.

Thank you

Hi Repo: https://github.com/RedFox64/-11515-FIIREBASE_AUTH-Unable-to-establish-connection-on-channel.-Android-Platform.- I sent the invitation to you.

danagbemava-nc commented 10 months ago

Hi @RedFox64, at what point do you get the error? I just attempted the sign up flow and it went on without any errors. I tested on a Pixel 7

RedFox64 commented 10 months ago

Hi @RedFox64, at what point do you get the error? I just attempted the sign up flow and it went on without any errors. I tested on a Pixel 7

Hi, I am getting the error both in the simulator and on physical devices. Below is a screenshot of the error and its occurrence. Screenshot 2023-08-25 at 15 20 16 Physical device was photo_2023-08-25 15 11 09 Video: https://github.com/firebase/flutterfire/assets/22937093/0b8e5c82-e4f4-48c7-bf9c-e0cd48197a94

danagbemava-nc commented 10 months ago

Hi @RedFox64, can you try with the plugin example app to see if you still get this issue? I tested again with your sample app but I could not reproduce the error

RedFox64 commented 10 months ago

Hi @danagbemava-nc I tried again and I have the same issue. You can see it by the link and screenshot: https://github.com/firebase/flutterfire/assets/22937093/0b8e5c82-e4f4-48c7-bf9c-e0cd48197a94

Screenshot 2023-08-29 at 11 49 25

danagbemava-nc commented 10 months ago

Hi @RedFox64, were you able to test the firebase_auth plugin example to see if the same issue reproduces?

google-oss-bot commented 10 months ago

Hey @RedFox64. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 9 months ago

Since there haven't been any recent updates here, I am going to close this issue.

@RedFox64 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.