global evaluation is not supported on Vscode when use shift+r flutter

7,114

Solution 1

Add configuration "console":"terminal" in launch.json

Example:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "dart_application_1",
            "request": "launch",
            "type": "dart",
            "program": "bin/dart_application_1.dart",
            "console": "terminal"
        }
    ]
}

More details available here

Solution 2

The VS Code debugger for Dart/Flutter does not currently support global evaluation (there's an open issue for this here). Add a 👍 to that issue if it's something you'd like to see.

The debug console can be used for evaluation when execution is paused (eg. you've stopped at a breakpoint or similar) - this is evaluation in the context of the current frame.

Share:
7,114
Jack Jack
Author by

Jack Jack

Updated on December 10, 2022

Comments

  • Jack Jack
    Jack Jack over 1 year

    When I use hot reload on my debug console it says "global evaluation not supported". How do I fix this problem?

    Before I read this global evaluation, but it did not help me

    This is the image of my problem

    • rmtmckenzie
      rmtmckenzie about 5 years
      Can you try running flutter run directly on the command line to see if that works? And make sure that when you run flutter doctor -v that you don't get any warnings or errors...
  • starzar
    starzar about 3 years
    Hi,on generating the Dart(2.12.0-141.0.dev) template 'SimpleConsoleApplication' from command palette ,didn't create the launch.json file in dart tools (only package_config.json created).Which template did you use?Thanks.
  • ManuH68
    ManuH68 about 2 years
    If you click on run and debug on the left side of VS Code, it will propose you to create the json file. Otherwise you can create manually the file launch.json it has to be in a folder .vscode in the root of your project.