Tom
Tom

Reputation: 1650

Cannot find referenced source: package:unittest/unittest.dart

I'm unable to import files using the pub package syntax like the following:

#import("package:unittest/unittest.dart");

I receive the following compile time error:

Cannot find referenced source: package:unittest/unittest.dart

Steps to Reproduce: 1) Installed the following Dart Editor for windows https://gsdview.appspot.com/dart-editor-archive-integration/latest/darteditor-win32-64.zip. 2) Get some project that uses pub. 3) pub install //works 4) Open the project in the dart editor

I see a lot of people using this so I'm betting I'm doing something terribly wrong.

Upvotes: 2

Views: 645

Answers (2)

John Evans
John Evans

Reputation: 7383

I probably should have posted this as an answer.

Have you setup your pubspec.yaml file which declares your intent to use the unittest package? The other piece is that you (at this point in time) need to setup the package source directory for the Editor. It's in Tools -> Preferences. Point it to the package/ folder in your project.

Upvotes: 3

Tom
Tom

Reputation: 1650

Thanks Mr. Evans!

" The other piece is that you (at this point in time) need to setup the package source directory for the Editor. It's in Tools -> Preferences. Point it to the package/ folder in your project."

Upvotes: 0

Related Questions