Closed AshuSharma7 closed 1 year ago
I have the same problem and how it happend. I have enabled Appcheck verification then I rebuilt the project in debug mode and it was still authenticated user. When i tried to sign out. I received that error
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [firebase_auth/channel-error] Unable to establish connection on channel.
E/flutter (12177): #0 FirebaseAuthHostApi.signOut (package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart:1207:7)
E/flutter (12177): <asynchronous suspension>
E/flutter (12177): #1 MethodChannelFirebaseAuth.signOut (package:firebase_auth_platform_interface/src/method_channel/method_channel_firebase_auth.dart:417:7)
E/flutter (12177): <asynchronous suspension>
E/flutter (12177): #2 FirebaseAuth.signOut (package:firebase_auth/src/firebase_auth.dart:721:5)
E/flutter (12177): <asynchronous suspension>
E/flutter (12177): #3 MainDrawer.build.<anonymous closure> (package:tags/ui/widgets/mainDrawer.dart:190:19)
E/flutter (12177): <asynchronous suspension>
And now after deleting cache on emulater and reinstal APP I am tring to sign in by Phone Auth. And the same error
The following exception was thrown signInWithPhoneNumber error for Android or IOS:
I/flutter (13533): [firebase_auth/channel-error] Unable to establish connection on channel.
I/flutter (13533): #0 FirebaseAuthHostApi.verifyPhoneNumber (package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart:1394:7)
I/flutter (13533):
From pubspec.yaml
firebase_auth: 4.7.3 firebase_core: ^2.15.1 firebase_analytics: ^10.2.1 firebase_messaging: ^14.4.1 cloud_functions: ^4.3.2 firebase_storage: ^11.1.1 firebase_crashlytics: ^3.1.2 firebase_dynamic_links: ^5.1.1 firebase_performance: ^0.9.1+1
main.dart
void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); await FirebaseAppCheck.instance.activate( webRecaptchaSiteKey: '6Le6k_0nAAAAALXKi3nUK9N2Otiyy0igKrLZ-Hur', // Default provider for Android is the Play Integrity provider. You can use the "AndroidProvider" enum to choose // your preferred provider. Choose from: // 1. Debug provider // 2. Safety Net provider // 3. Play Integrity provider androidProvider: AndroidProvider.debug, // Default provider for iOS/macOS is the Device Check provider. You can use the "AppleProvider" enum to choose // your preferred provider. Choose from: // 1. Debug provider // 2. Device Check provider // 3. App Attest provider // 4. App Attest provider with fallback to Device Check provider (App Attest provider is only available on iOS 14.0+, macOS 14.0+) appleProvider: AppleProvider.appAttest, );
And now i am triyng to sign in by phone Auth at debag Web. And there is different error.
TypeError: Cannot create property 'callback' on string '__ff-recaptcha-container'
https://www.gstatic.com/firebasejs/9.22.1/firebase-auth.js 1:99887 new oi
packages/firebase_auth_web/src/interop/auth.dart 1079:20 new
packages/firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart 92:30 new
packages/firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart 110:12 delegateFor
packages/firebase_auth/src/recaptcha_verifier.dart 58:16 new
packages/firebase_auth/src/firebase_auth.dart 675:18
signInWithPhoneNumber
and web release doest not work too with different error in console
POST https://identitytoolkit.googleapis.com/v1/accounts:sendVerificationCode?key=AIzaSyAMlqlvYs8xf6qo2IFEqA3BfIytrPZ8WJo error - 500
(анонимный) @ main.dart.js:9279
main.dart.js:41113 [firebase_auth/internal-error-encountered.] Error
main.dart.js:41113 [firebase_auth/internal-error-encountered.] Error
at Object.c (https://tags-26739.web.app/main.dart.js:4991:19)
at https://tags-26739.web.app/main.dart.js:69027:9
at blY.a (https://tags-26739.web.app/main.dart.js:6376:62)
at blY.$2 (https://tags-26739.web.app/main.dart.js:56988:14)
at bkO.$2 (https://tags-26739.web.app/main.dart.js:56985:16)
at bhE.aZO (https://tags-26739.web.app/main.dart.js:58011:36)
at bhE.agV (https://tags-26739.web.app/main.dart.js:58013:24)
at nt.X0 (https://tags-26739.web.app/main.dart.js:57301:18)
at bda.$0 (https://tags-26739.web.app/main.dart.js:57454:37)
at Object.JP (https://tags-26739.web.app/main.dart.js:6515:78)
Reproducible using the code sample in the original post.
@kirillnepomiluev, you are likely hitting a different issue so kindly file a new issue and provide detailed information required to reproduce.
Thank you
@AshuSharma7 I was able to reproduce with your repo, but I created a fresh Flutter project and used latest FlutterFire dependencies and it worked fine:
cached_network_image:
auto_size_text: ^3.0.0
syncfusion_flutter_pdfviewer: ^22.2.10
provider: ^6.0.5
esys_flutter_share_plus: ^2.2.0
launch_review: ^3.0.1
url_launcher:
android_intent_plus: ^4.0.2
flutter_email_sender: ^6.0.1
drop_cap_text: ^1.0.7
flutter_local_notifications: ^15.1.1
firebase_core: ^2.17.0
cloud_firestore: ^4.9.3
firebase_messaging: ^14.6.9
If you want to report an issue @kirillnepomiluev, please open a separate issue. Thanks.
@russellwheatley With a fresh flutter project everything's working fine but I'd an old project which I upgraded to lastes flutter version and since then I'm facing that issue with firebase
Bug report
Describe the bug Recently I upgraded all the packages of an old project. It was on non null-safety and I updated it for null safety. I updated all the packages of firebase as well. After that I started getting this platform exception upon initialisation of firebaseApp.
Steps to reproduce
Steps to reproduce the behavior:
I'm getting this with my old projects. New ones are working perfectly fine so not sure how can I provide steps for reproducing this issue but I'll provide a dummy project in which error will occur
Expected behavior
App should run normally but it fails at initialisation and app gets stuck because of that platform exception of firebase app
Sample project
Here I'm providing a demo project in which I'm getting the error. I've only kept the required files here so that app will run. repo: https://github.com/AshuSharma7/panchang_issue
Additional context
This is the whole error
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.10.6, on macOS 13.4 22F66 darwin-arm64, locale en-IN) ! Warning: `flutter` on your path resolves to /Users/ashusharma/Development/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /users/ashusharma/Development/flutter. Consider adding /users/ashusharma/Development/flutter/bin to the front of your path. ! Warning: `dart` on your path resolves to /Users/ashusharma/Development/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /users/ashusharma/Development/flutter. Consider adding /users/ashusharma/Development/flutter/bin to the front of your path. [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 14.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] VS Code (version 1.81.1) [✓] Connected device (3 available) [✓] Network resources ! Doctor found issues in 1 category. ```Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
``` Dart SDK 3.0.6 Flutter SDK 3.10.6 shivshaktipanchang 1.0.2+6 dependencies: - admob_flutter 3.0.0 [flutter] - android_intent_plus 4.0.2 [flutter platform meta] - auto_size_text 3.0.0 [flutter] - cached_network_image 3.2.3 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web] - cloud_firestore 4.9.1 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - cupertino_icons 1.0.6 - drop_cap_text 1.1.3 [flutter] - esys_flutter_share_plus 2.2.0 [flutter path_provider] - firebase_core 2.15.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_messaging 14.6.7 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine] - flutter_email_sender 6.0.1 [flutter] - flutter_local_notifications 15.1.1 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone] - get 4.6.5 [flutter] - google_mobile_ads 3.0.0 [meta flutter visibility_detector webview_flutter_android webview_flutter_wkwebview webview_flutter] - launch_review 3.0.1 [flutter] - material_design_icons_flutter 7.0.7296 [flutter] - provider 6.0.5 [collection flutter nested] - syncfusion_flutter_pdfviewer 22.2.11 [flutter vector_math async http uuid device_info_plus intl syncfusion_pdfviewer_platform_interface syncfusion_pdfviewer_web syncfusion_pdfviewer_macos syncfusion_pdfviewer_windows syncfusion_flutter_core syncfusion_flutter_pdf syncfusion_flutter_signaturepad url_launcher] - url_launcher 6.1.14 [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: - flutter_launcher_icons 0.13.1 [args checked_yaml cli_util image json_annotation path yaml] - flutter_native_splash 2.3.2 [args flutter flutter_web_plugins js html image meta path universal_io xml yaml] - 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] transitive dependencies: - _flutterfire_internals 1.3.5 [collection firebase_core firebase_core_platform_interface flutter meta] - archive 3.3.8 [crypto path pointycastle] - args 2.4.2 - async 2.11.0 [collection meta] - boolean_selector 2.1.1 [source_span string_scanner] - 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] - characters 1.3.0 - checked_yaml 2.0.3 [json_annotation source_span yaml] - cli_util 0.4.0 [meta path] - clock 1.1.1 - cloud_firestore_platform_interface 5.16.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 3.7.0 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js] - collection 1.17.1 - convert 3.1.1 [typed_data] - crypto 3.0.3 [typed_data] - csslib 1.0.0 [source_span] - dbus 0.7.8 [args ffi meta xml] - device_info_plus 9.0.3 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32 win32_registry] - 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 7.0.0 [meta path] - firebase_core_web 2.7.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - 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] - flutter_blurhash 0.7.0 [flutter] - flutter_cache_manager 3.3.1 [clock collection file flutter http path path_provider rxdart sqflite uuid] - flutter_local_notifications_linux 4.0.0+1 [dbus ffi flutter flutter_local_notifications_platform_interface path xdg_directories] - flutter_local_notifications_platform_interface 7.0.0+1 [flutter plugin_platform_interface] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math] - html 0.15.4 [csslib source_span] - http 1.1.0 [async http_parser meta] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image 4.0.17 [archive meta xml] - intl 0.18.1 [clock meta path] - js 0.6.7 [meta] - json_annotation 4.8.1 [meta] - matcher 0.12.15 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.2.0 - meta 1.9.1 - nested 1.0.0 [flutter] - octo_image 1.0.2 [flutter flutter_blurhash] - path 1.8.3 - 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.0 [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] - platform 3.1.2 - plugin_platform_interface 2.1.6 [meta] - pointycastle 3.7.3 [collection convert js] - rxdart 0.27.7 - sky_engine 0.0.99 - source_span 1.9.1 [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] - string_scanner 1.2.0 [source_span] - syncfusion_flutter_core 22.2.11 [vector_math flutter] - syncfusion_flutter_pdf 22.2.11 [flutter intl xml syncfusion_flutter_core crypto convert] - syncfusion_flutter_signaturepad 22.2.11 [flutter syncfusion_flutter_core] - syncfusion_pdfviewer_macos 22.2.11 [flutter syncfusion_pdfviewer_platform_interface] - syncfusion_pdfviewer_platform_interface 22.2.11 [flutter plugin_platform_interface] - syncfusion_pdfviewer_web 22.2.11 [flutter flutter_web_plugins js meta syncfusion_pdfviewer_platform_interface] - syncfusion_pdfviewer_windows 22.2.11 [flutter] - synchronized 3.1.0 - 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] - timezone 0.9.2 [path] - typed_data 1.3.2 [collection] - universal_io 2.2.2 [collection meta typed_data] - url_launcher_android 6.1.0 [flutter url_launcher_platform_interface] - url_launcher_ios 6.1.5 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.6 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.7 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.5 [flutter plugin_platform_interface] - url_launcher_web 2.0.19 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.8 [flutter url_launcher_platform_interface] - uuid 3.0.7 [crypto] - vector_math 2.1.4 - visibility_detector 0.3.3 [flutter] - webview_flutter 4.2.4 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview] - webview_flutter_android 3.9.5 [flutter webview_flutter_platform_interface] - webview_flutter_platform_interface 2.5.1 [flutter meta plugin_platform_interface] - webview_flutter_wkwebview 3.7.4 [flutter path webview_flutter_platform_interface] - win32 5.0.7 [ffi] - win32_registry 1.1.1 [ffi win32] - xdg_directories 1.0.3 [meta path] - xml 6.3.0 [collection meta petitparser] - yaml 3.1.2 [collection source_span string_scanner] ```