flutter devtools websocket exception websocket connection failed

515 Views Asked by At

I am trying to use flutter devtools using android issue. I have valid url: http://127.0.0.1:9200/13hh2pxQQ-Q=/ generated through android studio itself while running the program. Still, whenever i tried to connect to devtools , i get the error as specified in the image. enter image description here

1

There are 1 best solutions below

0
marcinj On

Had the same issue in my android app, it is a java/kotlin application with flutter embeddedings. So to solve it, I first upgraded to newest AGP - in my case 8.2.2 - also newest Android Studio HedgeHog 2023.1.1 Patch 2, synced project. But the flutter is not the newest version - its 3.13.9 from stable chanell. Also upgrade flutter/dart plugins in AS.

Then I kill my app process on device. In AS I Run -> Flutter Attach, then I see in Debug tool window a main.dart tab:

Waiting for a connection from Flutter on Pixel 4a...

I start my app on device, and then I see:

Debug service listening on ws://127.0.0.1:12345/dogGGHHOPZY=/ws

this url I copy/paste to devtools and it all works from now on.

ps. when I run application, I see in logcat url like this:

The Dart VM service is listening on http://127.0.0.1:39437/1ioVUr5wQHU=/

Whenever I input this url to devtools, I still get the same error as in question.