Error connecting to VM service for Flutter DevTools

Viewed 3963

The message I get is:

Unable to connect to VM service at http://127.0.0.1:53932/pq_PklwHCMK=/:
getDartDevelopmentServiceVersio: (-32601)
Method not found,
getDartDevelopmentServiceVersio: (-32601)
Method not found

What I have tried:

  • Restarting computer
  • Restarting VScode
  • Restarting Emulator
  • Wiping AVD data
  • Coldboot AVD
  • Tried opening devtools in browser, same message
  • Checked flutter doctor for any issues (none)

This was working for years until now, and I do see that in VScode that Dar and Flutter for VScode was updated 1 hour ago to 3.19.0 so I downgraded but I still get this same issue.

enter image description here

2 Answers

This issue should have been fixed since devtools version 0.9.7+2 as mentioned on this GitHub issue ticket. If you're still using an older version and encounters this issue, I recommend updating to the latest version of devtools.

  void main() async {
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );
  runApp(const MyApp());
}

to

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );
  runApp(const MyApp());
}

and write in terminal

flutter pub global activate devtools 0.9.6+3

and

dart pub global activate devtools 0.9.6+3
Related