找不到引用的源码:packages [英] Cannot find referenced source: packages

查看:147
本文介绍了找不到引用的源码:packages的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个pubspec.yaml

I have this pubspec.yaml

    name: Dart Pages
    description: The Dart platform.
    dependencies:
      web_components: any
      mongo_dart: any

我运行工具> Pub安装,操作成功完成。

then I run Tools > Pub Install, the operation completes successfully.

当我运行应用程序时,我得到以下错误:

When I run the application I get the following error:

    dart --enable-checked-mode web\page.dart
    Unable to open file: C:/Users/Samer/Documents/GitHub/dart/web/packages/mongo_dart/mongo_dart.dart'file:///C:/Users/Samer/Documents/GitHub/dart/web/page.dart': Error: line 1 pos 1: library handler failed
    #import("package:mongo_dart/mongo_dart.dart");

我使用的是Windows 7 64bit&最新的Dart编辑器版本0.2.1_r14167

I'm using Windows 7 64bit & Latest Dart Editor version 0.2.1_r14167

问题似乎不是只有mongo_dart,而是所有其他库,编辑器寻找错误的路径, dart / web / packages,而我看到一个文件夹/ dart / packages。

The issues seems not be with only mongo_dart, but all other libraries as well, the editor is looking for the wrong path over packages at /dart/web/packages, while i see a in folder /dart/packages.

感谢您的帮助和时间。

推荐答案

我有一个类似的问题TeamCity。在我的开发机器我可以做 pub get pub build 一遍又一遍,它的工作原理很好,第一次使用TeamCity构建解决方案。

I had a similar problem with TeamCity. On my development machine I can do pub get and pub build over and over and it works just great, but this only worked the very first time I built the solution using TeamCity.

经过大量的混乱我终于发现了,大多是试验和错误,问题是由TeamCity造成的在创建解决方案之前清理文件夹。

After a lot of messing around I finally discovered, mostly by trial and error, that the problem was caused by TeamCity cleaning the folder before building the solution.

我找不到任何合理的文档,如何 pub 工作,我不知道为什么这只是工作的第一次,但我的试验和错误发现执行 pub缓存修复在每个构建 pub get ,最后 pub build 可重复工作,我的TeamCity项目现在每次都会成功创建。

I can't find any reasonable documentation for how pub works, and I don't know why this only works the very first time, but my trial and error discovered that executing pub cache repair on every build before pub get and finally pub build works repeatably, and my TeamCity project now builds successfully every time.

这篇关于找不到引用的源码:packages的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆