Question

Failed to start DevTools: Dart DevTools exited with code 255

I am getting this error code in my Visual Studio Code. How can I fix it?

I am using Flutter v2.5.3.

 48  16015  48
1 Jan 1970

Solution

 69

You can try fixing it by running this in the terminal:

Just copy and paste the below code into the terminal and run it.

dart pub global activate devtools -v 2.8.0

which downgrades the version to 2.8.0 (that works fine). I found the answer on GitHub.

2021-12-22

Solution

 7

I agree with RandomCoder's answer to avoid executing command

dart pub global activate devtools -v 2.8.0

every time before opening Visual Studio Code.

And also if you didn't know the location of the build folder mentioned by RandomCoder, I found the location after reading it here for the pub cache folder:

By default, this directory is located under . pub-cache in your home directory (on macOS and Linux), or in %LOCALAPPDATA%\Pub\Cache (on Windows). (The precise location of the cache may vary depending on the Windows version.)

After you found it, go to the \hosted\pub.dartlang.org\devtools-2.8.0 directory to copy the build version there and paste it in \hosted\pub.dartlang.org\devtools-2.9.2.

I still didn't know if there is any bad effects of copy pasting it to a newer version folder, but in my case it's working until now.

2021-12-27