Skip to content

Always show Starting DevTools #5234

@xkeyC

Description

@xkeyC

Thanks for the feedback! If your issue is related to the Flutter framework itself,
please open an issue at
github.com/flutter/flutter.

Steps to Reproduce

image

I am using flutter in China, and I must access dart pub through http proxy, but the flutter intellij plugin does not support the use of idea proxy settings.
When I start android-studio by adding the http_proxy environment variable, flutter_intellij uses the proxy correctly, but I cannot debug and run the flutter app.

Use Http Proxy
set http_proxy=http://127.0.0.1:7890 & set https_proxy=http://127.0.0.1:7890
"C:\Program Files\Android\Android Studio\bin\studio64.exe"

Starting DevTools will load normally, but:

[        ] Waiting for observatory port to be available...
[+3036 ms] Observatory URL on device: http://127.0.0.1:37729/Emoi_L7U-s8=/
[        ] executing: C:\Users\me\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:0 tcp:37729
[  +40 ms] 11498
[        ] Forwarded host port 11498 to device port 37729 for Observatory
[   +4 ms] Caching compiled dill
[  +41 ms] Connecting to service protocol: http://127.0.0.1:11498/Emoi_L7U-s8=/
[ +206 ms] Exception attempting to connect to the VM Service: WebSocketException: Connection to 'http://127.0.0.1:11498/Emoi_L7U-s8=/ws#' was not upgraded to websocket
[        ] This was attempt #1. Will retry in 0:00:00.100000.
[  +12 ms] E/DartVM  (30122): vm-service: Error: Unhandled exception:
[        ] E/DartVM  (30122): WebSocketException: Invalid WebSocket upgrade request
[        ] E/DartVM  (30122): 
[        ] E/flutter (30122): [ERROR:flutter/runtime/dart_isolate.cc(1137)] Unhandled exception:
[        ] E/flutter (30122): WebSocketException: Invalid WebSocket upgrade request
[ +109 ms] Fail to connect to service protocol: http://127.0.0.1:11498/Emoi_L7U-s8=/: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:11498/Emoi_L7U-s8=/ws
Activating Dart DevTools...
[{"event":"app.progress","params":{"appId":"14233403-292e-4903-8e05-627f62656f86","id":"2","progressId":null,"message":"Activating Dart DevTools...","finished":false}}]
[{"event":"app.progress","params":{"appId":"14233403-292e-4903-8e05-627f62656f86","id":"2","progressId":null,"finished":true}}]
[+9085 ms] Error connecting to the service protocol: failed to connect to http://127.0.0.1:11498/Emoi_L7U-s8=/

If use http_proxy environment variable,flutter run will Will be damaged.

I think the best solution

flutter-intellij should read the proxy settings of the idea and attach it to the runtime environment when executing any flutter pub.

image

If execute flutter run, should not use a proxy.

image

Version info

flutter-intellij: 53.0.1
flutter:

[√] Flutter (Channel master, 1.26.0-18.0.pre.90, on Microsoft Windows [Version 10.0.19042.746], locale zh-CN)
    • Flutter version 1.26.0-18.0.pre.90 at C:\Users\me\AppData\Local\Android\flutter
    • Framework revision 25134a16d1 (3 days ago), 2021-01-29 23:52:30 -0800
    • Engine revision ce14c8a841
    • Dart version 2.12.0 (build 2.12.0-276.0.dev)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\me\AppData\Local\Android\Sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = C:\Users\me\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.52.1)
    • VS Code at C:\Users\me\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[!] Proxy Configuration
    • HTTP_PROXY is set
    ! NO_PROXY is not set

[√] Connected device (3 available)
    • sdk gphone x86 64 arm64 (mobile) • emulator-5554 • android-x64    • Android 11 (API 30) (emulator)
    • Chrome (web)                     • chrome        • web-javascript • Google Chrome 88.0.4324.104
    • Edge (web)                       • edge          • web-javascript • Microsoft Edge 88.0.705.53

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions