1

Machine: Linux (Ubuntu 17.04)

Trying to execute this program: example/example_interleaved_execution.dart

$ dart example_interleaved_execution.dart

Error:

Unhandled exception:
Could not import "package:threading/threading.dart" from "file:///home/xxxxs/devel/dartprog/example_interleaved_execution.dart": Could not resolve a package location for base at file:///home/xxxxs/devel/dartprog/example_interleaved_execution.dart
null:

Already Tried:

  • pub cache repair Post1
  • Deleted ~/.pub-cache
  • Rebooted machine and tried $ dart example_interleaved_execution.dart and same error.

How to solve this one?

(Note: If anyone is working behind proxy, make sure "pub" is working under root too.)

SH'
  • 186
  • 2
  • 10

1 Answers1

1

You probably need to generate a pubspec.yaml file yourself with a config somewhat like this:

name: my_test_lib

dependencies:
  threading: ^0.0.8

Then you can do a pub get which will install the needed dependency.

Maximilian Riegler
  • 22,720
  • 4
  • 62
  • 71