仅在执行调试构建时才能读取'package:intl / intl.dart'

时间:2015-06-30 17:00:15

标签: dart dart-pub dart2js

如果我'Pub Build - Minified'我的应用程序编译并正确运行。如果我改为'Pub Build - Debug',我会收到以下错误:

[Error from Dart2JS on App|web/view_assignment.dart]:
web\code_admin.dart:6:8:
Can't read 'package:intl/intl.dart' (Could not find asset intl|lib/intl.dart.).
import 'package:intl/intl.dart';
       ^^^^^^^^^^^^^^^^^^^^^^^^
[Info from Dart2JS]:
Took 0:00:07.185411 to compile App|web/view_assignment.dart.
[Info from Dart2JS]:
Compiling App|web/main.dart...
[Error from Dart2JS on App|web/main.dart]:
web\code_admin.dart:6:8:
Can't read 'package:intl/intl.dart' (Could not find asset intl|lib/intl.dart.).
import 'package:intl/intl.dart';
       ^^^^^^^^^^^^^^^^^^^^^^^^
[Warning from Dart2JS on App|web/main.dart]:
web\index_view.dart:97:7:
Cannot resolve type 'DateFormat'.
      DateFormat acceptUntilFormat = new DateFormat('yyyy-MM-dd H:m');
      ^^^^^^^^^^
[Warning from Dart2JS on App|web/main.dart]:
web\index_view.dart:97:42:
Cannot resolve 'DateFormat'.
      DateFormat acceptUntilFormat = new DateFormat('yyyy-MM-dd H:m');
                                         ^^^^^^^^^^
[Info from Dart2JS]:
Took 0:00:06.744386 to compile App|web/main.dart.
Build failed.

我的pubspec.yaml有以下条目:

name: App
version: 0.0.1
description: An absolute bare-bones web app.
environment:
  sdk: '>=1.0.0 <2.0.0'
dependencies:
  bootjack: any
  browser: 0.10.0+1
  intl: any

文件夹App / packages / intl存在一堆包含intl.dart的dart文件。请指教。

0 个答案:

没有答案