当前位置: 动力学知识库 > 问答 > 编程问答 >

dartium - 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.

网友答案:

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.

网友答案:

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."

分享给朋友:
您可能感兴趣的文章:
随机阅读: