question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't start DevTools from VS Code: Dart DevTools exited with code 66

See original GitHub issue

Hi there,

I get “code 66” error when trying to start DevTools from VS Code. Here’s my log:

Dart Code extension: 3.9.1
Flutter extension: 3.9.1 (not activated)
VS Code: 1.44.2
Platform: linux
Workspace type: Flutter
Multi-root?: false
Dart SDK:
    Loc: /home/machine/tools/flutter/bin/cache/dart-sdk
    Ver: 2.7.2
Flutter SDK:
    Loc: /home/machine/tools/flutter
    Ver: 1.12.13+hotfix.9
HTTP_PROXY: undefined
NO_PROXY: undefined

Mon Apr 27 2020 [13:26:30 ...] Log file started
[13:26:36] [CommandProcesses] [Info] (PROC 11029) Logging data for process...
[13:26:37] [CommandProcesses] [Info] (PROC 11029) devtools 0.2.3
[13:26:37] [CommandProcesses] [Info] (PROC 11029) exited (0, null)
[13:26:37] [CommandProcesses] [Info] (PROC 11029) closed (0, null)
[13:26:37] [DevTools] [Info] Spawning /home/machine/tools/flutter/bin/cache/dart-sdk/bin/pub with args ["global","run","devtools","--machine","--enable-notifications","--try-ports","10"]
[13:26:37] [DevTools] [Info] ..  with {"toolEnv":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code"}}
[13:26:37] [DevTools] [Info]     PID: 6638
[13:26:37] [DevTools] [Error] Could not find a file named "pubspec.yaml" in "/home/machine/.pub-cache/hosted/pub.dartlang.org/devtools-0.2.3".
[13:26:37] [DevTools] [Info] Process terminated! 66, null
[13:26:37] [General] [Error] Dart DevTools exited with code 66
[13:26:37] [General] [Error] Dart DevTools exited with code 66
Mon Apr 27 2020 [13:26:41 ...] Log file ended

I followed the steps in #2128 and deactivated then reactivated devtools. What I noticed though was that it’s looking for the pubspec.yaml file in ~/.pub-cache/hosted/pub.dartlang.org/devtools-0.2.3 but the directory ~/.pub-cache/hosted does not exist.

I did have issues with my flutter environment a while back, and may have removed ~/.pub-cache/hosted to fix my dependencies, but I can’t remember for sure. It was a long day and my caffeine levels were dangerously low!

Any idea on how I could fix this? Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

9reactions
crendocommented, Apr 28, 2021

I had this issue. [SOLVED] as follow:

dart pub cache repair dart pub cache add devtools dart pub cache repair dart pub global activate devtools dart pub global run devtools (to check it’s working)

5reactions
ZaferAlemdaroglucommented, May 6, 2020

i have same problem. Commands from terminal did not work.

=>flutter pub global list devtools 0.2.4

=>flutter pub global deactivate devtools Deactivated package devtools 0.2.4.

=>flutter pub global activate devtools Downloading… Precompiling executables… Precompiled devtools:devtools. Installed executable devtools. Activated devtools 0.2.4.

=>flutter pub global run devtools

Unhandled exception:
Invalid argument(s): A directory corresponding to fileSystemPath "...Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/devtools-0.2.4/build" could not be found

#0      createStaticHandler (package:shelf_static/src/static_handler.dart:50:5)
#1      defaultHandler (package:devtools_server/src/external_handlers.dart:41:23)
<asynchronous suspension>
#2      serveDevTools (package:devtools_server/src/server.dart:211:21)
#3      serveDevToolsWithArgs (package:devtools_server/src/server.dart:149:10)
#4      main (file:///Users/zaferyasinalemdaroglu/Desktop/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/devtools-0.2.4/bin/devtools.dart:9:3)
#5      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:305:32)
#6      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
pub finished with exit code 255
Read more comments on GitHub >

github_iconTop Results From Across the Web

Dart DevTools give an error when enabling in VSCode
I finally fixed this problem by deleting stuff in my .pub-cache directory that was in my home directory and not in my source...
Read more >
Failed to start DevTools: Dart DevTools exited with code 255.
Failed to start DevTools: Dart DevTools exited with code 255. I am getting this error code in my vscode. How to fix it?...
Read more >
Install and run DevTools from VS Code - Flutter documentation
Start a debug session for your application by opening the root folder of your project (the one containing pubspec.yaml ) in VS Code...
Read more >
Flutter Failed to start DevTools: Dart DevTools exited with ...
I re-opened VSCode after I installed it but Flutter didn't startup instead. [flutter] flutter doctor -v Can't load Kernel binary: Invalid kernel ...
Read more >
flutter create is not a valid dart package name. - You.com
See https://dart.dev/tools/pub/pubspec#name for more information. D:\code\flutter\flutter-boilerplate-project>rm -rf android ios ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found