Dart-Code: Dart DevTools exited with code 255 in brand new flutter installation

I am seeing this error message when trying to open DevTools from Visual Studio Code:

image

image

I tried running flutter pub global activate devtools but this didn’t fix the issue. I also tried running flutter pub global run devtools, but then I see this other error:

pub finished with exit code 65

I am not sure which other information is needed, so please let me know in case I need to provide anything else

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 23 (10 by maintainers)

Most upvoted comments

Running pub global activate devtools without flutter in the beginning fixed the issue for me. Thank you very much for the help! 😃

The issue was introduced with a DevTools update that just happened to go out around the same time as the Flutter update. VS Code will have auto-updated your DevTools to the latest one and then hit this issue.

Installing Google Chrome is the only workaround I know of until the DevTools fix is available in a release.

A new version of DevTools has been published that fixes this, so it’s no longer necessary to disable updates in the VS Code settings. Just run dart pub global activate devtools and leave the setting ticked and everything should be good.

I had the same problem. Try the following:

  1. Upgrade Flutter to 1.22.6
  2. Run the command pub global activate devtools
  3. Execute devtools in the terminal
    Resolved.

What if the fixed version (in our case version 0.2.4+1) is not available yet and I have already upgraded to the bad version?

The new version is already published on Pub, but if you’re using a mirror or something that prevents you getting it, you should be able to downgrade to the previous version with pub global activate devtools 0.2.3.

Is pub global activate devtools the same as flutter pub global activate devtools?

It depends how you installed Flutter, but if running flutter pub didn’t fix it, I would expect pub to. flutter pub and pub may have different pub-cache folders, and VS Code always uses pub when running DevTools (because it can be launched from non-Flutter apps and we don’t want to maintain two activated versions).

If pub isn’t in your PATH, you’ll need to provide the full path. That path may vary depending on where you’ve installed Flutter, but it’s at (flutter sdk)/bin/cache/dart-sdk/bin/pub.

Please let me know if you still have issues launching in VS Code after running pub global activate devtools (not flutter pub). This will become easier in the next version of VS Code.

If anyone knows why pub thinks they have DevTools installed but does not have a pubspec, I’d love to understand why this is happening so much lately. Have you manually deleted your pub cache folders or anything similar?