Skip to content

Error: Not found: 'dart:ui' when trying to run a Flutter project #3834

@noordawod

Description

@noordawod

Trying to run a Flutter project in VS Code yields many errors like this: Error: Not found: 'dart:ui'.

From looking at other issues (#2038, #1827) I understand that this is caused by trying to run a Dart project rather than a Flutter project. Well, I believe this is not the case in my project since the status bar does show Flutter and its version, in addition to selection of an emulator. The doctor also reports no issues whatsoever.

To Reproduce

I cannot share my code with the community (closed source), but the project opens and runs fine in both Android Studio and IntelliJ IDEA. The top-level directory contains a pubspec.yaml with a line reading sdk: "flutter".

Expected behavior
The project runs as a Flutter project.

Screenshots

Screenshot_2022-02-17_08-52-14

Screenshot_2022-02-17_08-53-30

Screenshot_2022-02-17_09-02-17

Versions (please complete the following information):

  • VS Code version: 1.64.2
  • Dart extension version: 3.34.0
  • Dart/Flutter SDK version: Flutter 2.11.0-0.0.pre.582 • channel master • Dart 2.17.0 (build 2.17.0-105.0.dev)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions