我正在尝试为Flutter项目开发Dart程序包。 它仅包含Dart(因此没有Flutter)代码。
当尝试使用Android Studio或IntelliJ运行单元测试时,出现以下错误:
Test framework quit unexpectedly
在输出窗口中,我收到以下消息:
Testing started at 21:38 ...
/Users/<user>/development/flutter/bin/cache/dart-sdk/bin/pub run test -r json /Users/<user>/Projects/personal/<project dir>/<project>
Observatory listening on http://127.0.0.1:57505/
Could not find a file named "pubspec.yaml" in "/Users/<user>/.pub-cache/hosted/pub.dartlang.org/test-1.5.3".
Process finished with exit code 66
整个.pub-cache
目录甚至都不存在...
如何使测试生效?
答案 0 :(得分:0)
我已经下载了另外一个配置了Android Studio和IntelliJ的Dart SDK,而不是Flutter随附的Dart SDK。
现在测试再次正常工作。