未加载Dart'SdkAnalysisContext'

时间:2016-03-02 09:22:42

标签: dart polymer

我想更新聚合物应用程序从版本“^ 0.16.4”到“1.0.0-rc.5”。我在pubspec.yaml中有一些行:

environment:
  sdk: '>=1.12.0 <2.0.0'

dependencies:
 bwu_datagrid:
   git:
     url: 'https://github.com/bwu-dart/bwu_datagrid'
     ref: 'polymer1'

 polymer: '1.0.0-rc.5'
 polymer_interop: '^1.0.0-rc.3'
 reflectable: '>=0.3.2 <0.3.4'
 web_components: '^0.12.0'

dependency_overrides:
 code_transformers: '^0.4.0'
 reflectable:'^0.5.0'
 redstone: '0.5.21+1'
 quiver: '>=0.21.3 <0.22.0'
 analyzer:'0.27.1'
 polymer:'^1.0.0-rc.5'
 args: '>=0.12.1 <0.14.0'

但是当我运行pub get时,我会收到错误:

Error on line 24, column 5 of ../../../.pub-cache/hosted/10.10.3.91%588080/initialize-0.6.1+2/pubspec.yaml: Error loading transformer: 'package:code_transformers/src/dart_sdk.dart': malformed type: line 128 pos 39: type 'SdkAnalysisContext' is not loaded
  final AnalysisContext context = new SdkAnalysisContext();
                                      ^
type error.
    $include: '**/*_test.dart'
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error on line 23, column 5 of ../../../.pub-cache/hosted/10.10.3.91%588080/polymer_interop-1.0.0-rc.7/pubspec.yaml: Error loading transformer: 'package:code_transformers/src/dart_sdk.dart': malformed type: line 128 pos 39: type 'SdkAnalysisContext' is not loaded
  final AnalysisContext context = new SdkAnalysisContext();
                                      ^
type error.
    $include: test/**_test{.*,}.html
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error on line 26, column 5 of ../../../.pub-cache/hosted/10.10.3.91%588080/web_components-0.12.0+4/pubspec.yaml: Error loading transformer: 'package:code_transformers/src/dart_sdk.dart': malformed type: line 128 pos 39: type 'SdkAnalysisContext' is not loaded
  final AnalysisContext context = new SdkAnalysisContext();
                                      ^
type error.
    $include: '**/*_test.html'
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error on line 19, column 3 of ../../../.pub-cache/hosted/10.10.3.91%588080/polymer-1.0.0-rc.5/pubspec.yaml: Error loading transformer: 'package:code_transformers/src/dart_sdk.dart': malformed type: line 128 pos 39: type 'SdkAnalysisContext' is not loaded
  final AnalysisContext context = new SdkAnalysisContext();
                                      ^
type error.
- web_components

dart --version Dart VM版本:1.13.2(2016年1月5日星期二06:49:57)“linux_x64”

pub --version Pub 1.13.2

可能有一些关于如何解决它的建议?

pubspec.yaml中的

变换器部分:

transformers:
 - polymer:
     entry_points:
       - web/index.html

 - $dart2js:
     minify: true
     commandLineOptions:
       - --trust-type-annotations
       - --trust-primitives
       - --enable-experimental-mirrors

pub serve print:

[Info from Reflectable on web_tt_client|web/index.bootstrap.initialize.dart]:
Ignoring entry point  that does not include the class `Reflectable`.
Build completed successfully

并在dartium控制台中:

Uncaught Unhandled exception:
Bad state: Reflectable has not been initialized. Did you forget to add the main file to the reflectable transformer's entry_points in pubspec.yaml?

spa.dart文件:

library spa;

import 'package:polymer/polymer.dart';
import 'package:web_tt_client/routers/routers.dart';

//Components
import 'package:web_tt_client/components/page_view/page_view.dart';

main() async {
  await initPolymer();
  await prepareViewElement();
  await prepareRouters();
}

index.html文件:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src='https://cdn.firebase.com/js/client/2.2.7/firebase.js'></script>
    <!-- JSON-Schema library tv4-->
    <script src="packages/web_tt_client/js/tv4/tv4.min.js"></script>

    <script src="packages/web_components/webcomponents.min.js"></script>

  </head>
  <body>

    <page-view></page-view>

    <br>
    <div id="html_log" style="white-space: nowrap;"></div>
    <script type="application/dart" src="spa.dart"></script>
    <script src="packages/browser/dart.js"></script>
  </body>
</html>

Pub更新。更新版本的软件包适用于:

grinder 0.6.6+3 (0.8.0+2 available)
http_multi_server 1.3.2 (2.0.0 available)
http_parser 0.0.2+8 (2.0.0 available)
postgresql 0.2.14 (0.3.3 available)
redstone 0.5.21+1 (0.6.0+1 available)
redstone_mapper 0.1.13 (0.2.0-beta.1+1 available)
redstone_mapper_pg 0.1.1 (0.2.0-beta.2+2 available)
shelf 0.5.7 (0.6.4+3 available)
test 0.12.3+9 (0.12.7 available)

1 个答案:

答案 0 :(得分:0)

更改pubspec.yaml dependency_overrides部分,可以解决它。

dependency_overrides:
 code_transformers: '^0.4.0'
 reflectable:'^0.5.0'
 redstone: '0.5.21+1'
 quiver: '>=0.21.3 <0.22.0'
 analyzer:'0.27.1'
 polymer:'^1.0.0-rc.5'
 args: '>=0.12.1 <0.14.0'