Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [firebase_auth] PlatformException on Windows 10: Unable to establish connection on channel #11595

Closed
KartikPatelOfficial opened this issue Sep 15, 2023 · 6 comments
Labels
plugin: auth resolution: solution-provided A solution has been provided in the issue. type: bug Something isn't working

Comments

@KartikPatelOfficial
Copy link

KartikPatelOfficial commented Sep 15, 2023

Bug report

Describe the bug
When attempting to use firebase_auth on Windows 10 with the provided example project, I encounter an error that indicates a failure to establish a connection on the channel.

Steps to reproduce

  1. Clone the example project for firebase_auth.
  2. Run the project on Windows 10.
  3. Observe the following errors:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      FirebaseAuthHostApi.registerIdTokenListener (package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart:847:7)
<asynchronous suspension>

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      FirebaseAuthHostApi.registerAuthStateListener (package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart:875:7)
<asynchronous suspension>

Expected behavior

The application should not encounter a PlatformException related to connection issues on the channel.


Additional context

Edition: Windows 10 Pro
Version: 22H2
OS build: 19045.3448

I'm facing this issue specifically with Windows.


Flutter doctor

Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.4, on Microsoft Windows [Version 10.0.19045.3448], locale en-IN)
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Chrome - develop for the web
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.4)
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.82.2)
[✓] Connected device (3 available)
[✓] Network resources

Flutter dependencies

Click To Expand
Dart SDK 3.1.2
Flutter SDK 3.13.4
firebase_auth_example 0.0.0

dependencies:
- barcode_widget 2.0.4 [barcode flutter]
- firebase_auth 4.9.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_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 material_color_utilities meta vector_math web sky_engine]
- flutter_signin_button 2.0.0 [flutter font_awesome_flutter]
- google_sign_in 6.1.5 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web]

dev dependencies:
- http 0.13.6 [async http_parser meta]

transitive dependencies:
- _flutterfire_internals 1.3.5 [collection firebase_core firebase_core_platform_interface flutter meta]
- async 2.11.0 [collection meta]
- barcode 2.2.4 [meta qr]
- boolean_selector 2.1.1 [source_span string_scanner]
- characters 1.3.0
- clock 1.1.1
- collection 1.17.2
- fake_async 1.3.1 [clock collection]
- firebase_auth_platform_interface 6.18.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 5.8.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_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_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]
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web]
- font_awesome_flutter 9.2.0 [flutter]
- google_identity_services_web 0.2.1+1 [js meta]
- google_sign_in_android 6.1.19 [flutter google_sign_in_platform_interface]
- google_sign_in_ios 5.6.3 [flutter google_sign_in_platform_interface]
- google_sign_in_platform_interface 2.4.2 [flutter plugin_platform_interface quiver]
- google_sign_in_web 0.12.0+5 [flutter flutter_web_plugins google_identity_services_web google_sign_in_platform_interface http js]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- js 0.6.7 [meta]
- matcher 0.12.16 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.5.0 [collection]
- meta 1.9.1
- path 1.8.3
- plugin_platform_interface 2.1.6 [meta]
- qr 3.0.1 [meta]
- quiver 3.2.1 [matcher]
- sky_engine 0.0.99
- source_span 1.10.0 [collection path term_glyph]
- stack_trace 1.11.0 [path]
- stream_channel 2.1.1 [async]
- string_scanner 1.2.0 [source_span]
- 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]
- typed_data 1.3.2 [collection]
- vector_math 2.1.4
- web 0.1.4-beta
@KartikPatelOfficial KartikPatelOfficial added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Sep 15, 2023
@danagbemava-nc danagbemava-nc added the triage Issue is currently being triaged. label Sep 15, 2023
@danagbemava-nc
Copy link

Hi @KartikPatelOfficial, windows is currently not supported for firebase_auth.

Do you have to perform any action to get the issue to occur?

PS: A pr landed recently regarding windows support, see #11089

@danagbemava-nc danagbemava-nc added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Sep 15, 2023
@KartikPatelOfficial
Copy link
Author

Hi @danagbemava-nc,

Thank you for your response. I understand that Windows support for firebase_auth is currently not fully supported, but I wanted to mention that I have also tried running the example project which includes the changes from PR #11089.

To answer your question, I didn't have to perform any specific action to reproduce the issue. I simply updated the firebase_options.dart in the example project and tried running it on Windows 10 Pro. Despite this, the aforementioned error still occurs.

Would appreciate any guidance or workaround for this issue.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Sep 15, 2023
@danagbemava-nc
Copy link

Thanks for the info.

It doesn't seem like that should happen. In any case, I think the best option would be to have it no-op if it is not supported yet. Labeling for further insight from the team on this.

cc @Lyokone

@danagbemava-nc danagbemava-nc added plugin: auth and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. labels Sep 19, 2023
@KartikPatelOfficial
Copy link
Author

Hi @danagbemava-nc, @Lyokone

Thank you for the updated library. I pulled the latest changes and tried running my app on Windows 10 again. The build completes successfully, but the app doesn't even show a window, and Flutter reports that the device has lost connection.

Here are the final lines from my logs for reference:

[        ]     162 Warning(s)
[        ]     0 Error(s)
[        ] Time Elapsed 00:00:39.55
[{"event":"app.progress","params":{"appId":"ceb82ebc-e4d5-4c5f-873a-a252a2fb6a0a","id":"0","progressId":null,"finished":true}}]
[  +14 ms] √  Built build\windows\runner\Debug\untitled.exe.
[ +436 ms] VM Service URL on device: http://127.0.0.1:63652/TQbkQ1SB9a0=/
[   +3 ms] Caching compiled dill
[  +18 ms] Connecting to service protocol: http://127.0.0.1:63652/TQbkQ1SB9a0=/
[ +108 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at http://127.0.0.1:63652/TQbkQ1SB9a0=/.
[  +61 ms] DDS is listening at http://127.0.0.1:63655/f6rvheJ87j8=/.
[  +55 ms] Successfully connected to service protocol: http://127.0.0.1:63652/TQbkQ1SB9a0=/
[  +17 ms] DevFS: Creating new filesystem on the device (null)
[  +14 ms] DevFS: Created new filesystem on the device (file:///C:/Users/karti/AppData/Local/Temp/untitled4d102039/untitled/)
[   +2 ms] Updating assets
Debug service listening on ws://127.0.0.1:63655/f6rvheJ87j8=/ws
[{"event":"app.debugPort","params":{"appId":"ceb82ebc-e4d5-4c5f-873a-a252a2fb6a0a","port":63655,"wsUri":"ws://127.0.0.1:63655/f6rvheJ87j8=/ws","baseUri":"file:///C:/Users/karti/AppData/Local/Temp/untitled4d102039/untitled/"}}]
Syncing files to device Windows...
[{"event":"app.progress","params":{"appId":"ceb82ebc-e4d5-4c5f-873a-a252a2fb6a0a","id":"1","progressId":null,"message":"Syncing files to device Windows...","finished":false}}]
[  +91 ms] Compiling dart to kernel with 0 updated files
[        ] Processing bundle.
[        ] <- recompile package:untitled/main.dart fda02671-bf3e-44db-94ef-cc4fc878dfa0
[        ] <- fda02671-bf3e-44db-94ef-cc4fc878dfa0
[   +1 ms] Bundle processing done.
[ +130 ms] Updating files.
[        ] DevFS: Sync finished
[{"event":"app.progress","params":{"appId":"ceb82ebc-e4d5-4c5f-873a-a252a2fb6a0a","id":"1","progressId":null,"finished":true}}]
[   +1 ms] Synced 0.0MB.
[   +1 ms] <- accept
[   +3 ms] Connected to _flutterView/0x17abacca250.
[{"event":"app.started","params":{"appId":"ceb82ebc-e4d5-4c5f-873a-a252a2fb6a0a"}}]
[+2590 ms] Service protocol connection closed.
[        ] Lost connection to device.
[        ] DevFS: Deleting filesystem on the device (file:///C:/Users/karti/AppData/Local/Temp/untitled4d102039/untitled/)
[{"id":0,"result":true}]

I've verified that my Visual Studio installation includes the necessary components for Windows development with Flutter.
Capture

Any guidance on resolving this issue would be greatly appreciated.

Best regards,
Kartik Patel

@milindgoel15
Copy link

milindgoel15 commented Sep 20, 2023

It also happens on other firebase plugins. I have used firebase_core, analytics and performance and upgrading them with latest available versions crashes the windows app, both while debugging and release build.

Affected versions:
https://katb.in/gaqinubanig

I am not exactly what exact plugin breaks it

@KartikPatelOfficial
Copy link
Author

Hi @milindgoel15,

Thanks for sharing your findings.

When I used the firebaseOptions.txt provided in the example, everything worked as expected. However, replacing it with my configuration led to the app crashing. I then attempted to modify the example firebaseOptions.dart to include the new options specific for Windows, only updating the apiKey, projectId, and authURL. This seems to have resolved the issue.

The problem appears to be related to the string pointer. This might be a deeper issue in how firebaseOptions are being parsed or handled for Windows in these Firebase plugins.

@danagbemava-nc danagbemava-nc added the resolution: solution-provided A solution has been provided in the issue. label Sep 25, 2023
@firebase firebase locked and limited conversation to collaborators Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
plugin: auth resolution: solution-provided A solution has been provided in the issue. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants