Skip to content

Can't locate Dart SDK #56942

@ds797

Description

@ds797

dart run isn't locating my Flutter SDK.
From the base project directory, when I run dart run build_runner build, or even dart run on it's own, I get the following error:

Because (name) depends on flutter_test from sdk which doesn't exist (the Flutter SDK is not available), version solving failed.

I ran flutter pub run build_runner build, which didn't give the same error. However, I'd like to use dart run since flutter pub run is deprecated. Why can't Dart find the Flutter SDK?

Stack Overflow question link (has more information): question

  • Dart version and tooling diagnostic info (dart info):

General info

Project info

  • sdk constraint: '>=3.5.0-56.0.dev <4.0.0'
  • dependencies: flutter, hive, isar_flutter_libs, path_provider
  • dev_dependencies: flutter_lints, flutter_test

Process info

Memory CPU Elapsed time Command line
66 MB 0.0% 01:49:42 dart devtools --machine --allow-embedding --dtd-uri ws:/uri
561 MB 0.1% 01:49:42 dart language-server --protocol=lsp --client-id=VS-Code --client-version=ver
81 MB 0.0% 01:49:42 dart tooling-daemon --machine
76 MB 0.1% 01:49:42 flutter_tools.snapshot daemon
  • Whether you are using Windows, macOS, or Linux (if applicable):
    Linux (Arch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.closed-as-intendedClosed as the reported issue is expected behaviortriage-automationSee https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions