-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed as not planned
Closed as not planned
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: regressionIt was better in the past than it is nowIt was better in the past than it is nowdependency: dartDart team may need to help usDart team may need to help usfound in release: 2.2Found to occur in 2.2Found to occur in 2.2has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
Steps to Reproduce
IMPORTANT Make sure your flutter version is 2.x, I reproduced the problem on 2.0.1 stable and 2.2.1 stable. But everything works fine on the old version like 1.22.3 stable. AND everything works fine on the simulator.
- Clone my demo project
flutter pub getflutter run: Run the demo on iPhone real device, Android real device and simulator.- Press the button in the demo, check debug output
Expected results: The connection on Flutter 2.x is normal like the Flutter 1.22.3.
Actual results:
| iOS device | Android device | Simulator | |
|---|---|---|---|
| Flutter 1.22.3 | ✅ | ✅ | ✅ |
| Flutter 2.0.1 | ❌ | ❌ | ✅ |
| Flutter 2.2.1 | ❌ | ❌ | ✅ |
Details
iOS real device output (iPhone 7 Plus with iOS 12.4, iPhone 11 Pro with iOS 14.0):
[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: SocketException: OS Error: Connection refused, errno = 61, address = 127.0.0.1, port = 63737
Android real device output (Samsung S10 with Android 11):
E/flutter (21242): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: SocketException: OS Error: Connection refused, errno = 111, address = 127.0.0.1, port = 57704
This is the core code:
ServiceProtocolInfo info = await Service.getInfo();
String url = info.serverUri.toString();
Uri uri = Uri.parse(url);
Uri socketUri = convertToWebSocketUrl(serviceProtocolUrl: uri);
final isolateId = Service.getIsolateID(Isolate.current);
final service = await vmServiceConnectUri(socketUri.toString());Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: regressionIt was better in the past than it is nowIt was better in the past than it is nowdependency: dartDart team may need to help usDart team may need to help usfound in release: 2.2Found to occur in 2.2Found to occur in 2.2has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team