Failed to start DevTools: Dart DevTools exited with code 255

Viewed 12073

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

I am using Flutter v2.5.3.

8 Answers

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.

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.

In my case there wasn’t any build folder in the devtools-2.9.2 folder.

I copied it from 2.8.0 and it now works.

For Android Studio


  • Close Android Studio
  • Rn dart pub global activate devtools -v 2.8.0 to downgrade (as suggested in a previous answer)
  • Open Android Studio
  • Run your build

For Visual Studio Code

  • Open Terminal
  • Run dart pub global activate devtools -v 2.8.0 to downgrade (as suggested a previous answer)

This is an issue coming since yesterday. Maybe they must have updated the Dart engine.

There are two ways which will help you to solve the issue.

  1. Update the Flutter SDK to the latest version and restart your PC:

    flutter upgrade
    
  2. Use the Dart Devtools manually

    Run flutter pub global in another terminal. Run devtools and then open http://127.0.0.1:9100

    Enter a running application field address of your running application in the Connect: "http://127.0.0.1:60230/J7_wS_YhTuo=/"

You can find this URL in debug console when you run the code.

√ Built build\app\outputs\flutter-apk\app-debug.apk. Connecting to VM Service at ws://127.0.0.1:51849/mHlycLJYEWw=/ws

If you are getting any issue regarding the port, then do this in your Flutter project console

flutter run --observatory-port=9100

Once the application starts you can see the message in the console.

If you are getting any server issue in the web browser then enter

dart devtools

In cmd

  1. Downgrade to devtools-2.8.0
  2. And activate using dart pub global activate devtools -v 2.8.0
  3. These two steps worked in my case

First activate your devtool using this command...

flutter pub global activate devtools
flutter pub global run devtools

And after that, try launching it from Visual Studio Code as described in the documentation: Install and run DevTools from VS Code

Related