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

It can't run in Chrome #1

Open
GreatGreatGreg opened this issue Oct 4, 2019 · 5 comments
Open

It can't run in Chrome #1

GreatGreatGreg opened this issue Oct 4, 2019 · 5 comments

Comments

@GreatGreatGreg
Copy link

GreatGreatGreg commented Oct 4, 2019

flutter run -d chrome

Flutter 1.10.7 • channel dev • https://github.com/flutter/flutter.git
Framework • revision e70236e36c (17 hours ago) • 2019-10-02 09:32:30 -0700
Engine • revision 9e6314d348
Tools • Dart 2.6.0 (build 2.6.0-dev.0.0 1103600280)

======================

Launching lib/main.dart on Chrome in debug mode...
Building application for the web...
Throwing away cached asset graph because the build phases have changed. This most commonly would happen as a result of adding a new dependency or updating your dependencies.
Skipping compiling nb|lib/main_web_entrypoint.dart with ddc because some of its
transitive libraries have sdk dependencies that not supported on this platform:

import 'package:websocket/websocket.dart';

https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings

Attempting to connect to browser instance..

@truongsinh
Copy link
Owner

Thanks for reporting, im travelling, thus it might take me awhile to look at it

@GreatGreatGreg
Copy link
Author

Fixed. It works after I switch to the latest master branch. Appreciate it

flutter/flutter#42228

@GreatGreatGreg
Copy link
Author

It works in Flutter for IOS and Flutter web. But it is not working in Flutter for Android.

try {
this.socket = await WebSocket.connect(WsUrl);
} catch (e) {
print(e)
}

got this:
OS Error: Connection refused, errno = 111, address = localhost, port = 54895

what can I do now? Thanks

@truongsinh
Copy link
Owner

@GreatGregLiu I doubt it's the server part (as the error says, "connection refused"). Please try to set WsUrl = "wss://echo.websocket.org" first to see whether it can connect to this referential implementation. Also, what WS server are using.

@GreatGreatGreg
Copy link
Author

@GreatGregLiu I doubt it's the server part (as the error says, "connection refused"). Please try to set WsUrl = "wss://echo.websocket.org" first to see whether it can connect to this referential implementation. Also, what WS server are using.

thanks. It works. In android emulator, it points to localhost which is not what I wanted and this is the reason that does not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants