无法解析“dart:core”的资产ID

时间:2015-11-27 20:20:21

标签: dart

我得到一个Unable来解决我在1.8和1.13之间尝试过的每个SDK的“dart:core”错误的资产ID,以及3种不同类型的带有不同dart插件的文本编辑器。有没有办法解决以下问题:

$ /c/tools/dart-sdk-1-9-3/bin/pub.bat serve
find: ‘>     bin [’: No such file or directory
Loading source assets...
Loading angular transformers...
Serving ProjectName web on http://localhost:8080
[Error from InjectorGenerator on ProjectName|web/main.dart]:
Unable to resolve asset ID for "dart:core"
Build error:
Transform InjectorGenerator on ProjectName|web/main.dart threw error: <rethrow>
Caused by Could not resolve dart:core
AnalysisTask._safelyPerform (package:analyzer/src/generated/engine.dart:6762:7)
      AnalysisTask.perform (package:analyzer/src/generated/engine.dart:6727:21)
      AnalysisContextImpl._cacheDartResolutionData (package:analyzer/src/generated/engine.dart:2414:86)
      AnalysisContextImpl._getDartResolutionData (package:analyzer/src/generated/engine.dart:3046:41)
      AnalysisContextImpl._getDartResolutionData2 (package:analyzer/src/generated/engine.dart:3077:36)
      AnalysisContextImpl.computeLibraryElement (package:analyzer/src/generated/engine.dart:1192:81)
      ResolverImpl._performResolve.<anonymous closure>.<anonymous closure> (package:code_transformers/src/resolver_impl.dart:157:46)
      MappedListIterable.elementAt (dart:_internal/iterable.dart:413)
      ListIterable.toList (dart:_internal/iterable.dart:219)
      ResolverImpl._performResolve.<anonymous closure> (package:code_transformers/src/resolver_impl.dart:158:16)
     _RootZone.runUnary (dart:async/zone.dart:1155)
     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:484)
     _Future._propagateToListeners (dart:async/future_impl.dart:567)
     _Future._completeWithValue (dart:async/future_impl.dart:358)
     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:412)
     _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
     _asyncRunCallback (dart:async/schedule_microtask.dart:48)
     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:143)


package:analyzer/src/generated/engine.dart 2115:11       AnalysisContextImpl.recordResolveDartLibraryTaskResults
package:analyzer/src/generated/engine.dart 5304:133      AnalysisContextImpl_AnalysisTaskResultRecorder.visitResolveDartLibraryTask
package:analyzer/src/generated/engine.dart 14327:77      ResolveDartLibraryTask.accept
package:analyzer/src/generated/engine.dart 6732:18       AnalysisTask.perform
package:analyzer/src/generated/engine.dart 2414:86       AnalysisContextImpl._cacheDartResolutionData
package:analyzer/src/generated/engine.dart 3046:41       AnalysisContextImpl._getDartResolutionData
package:analyzer/src/generated/engine.dart 3077:36       AnalysisContextImpl._getDartResolutionData2
package:analyzer/src/generated/engine.dart 1192:81       AnalysisContextImpl.computeLibraryElement
package:code_transformers/src/resolver_impl.dart 157:46  ResolverImpl._performResolve.<fn>.<fn>
dart:_internal/iterable.dart 413                         MappedListIterable.elementAt
dart:_internal/iterable.dart 219                         ListIterable.toList
package:code_transformers/src/resolver_impl.dart 158:16  ResolverImpl._performResolve.<fn>
dart:async/zone.dart 1155                                _RootZone.runUnary
dart:async/future_impl.dart 484                          _Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 567                          _Future._propagateToListeners
dart:async/future_impl.dart 358                          _Future._completeWithValue
dart:async/future_impl.dart 412                          _Future._asyncComplete.<fn>
dart:async/schedule_microtask.dart 41                    _asyncRunCallbackLoop
dart:async/schedule_microtask.dart 48                    _asyncRunCallback
dart:isolate-patch/isolate_patch.dart 96                 _runPendingImmediateCallback
dart:isolate-patch/isolate_patch.dart 143                _RawReceivePortImpl._handleMessage

package:analyzer/src/generated/engine.dart 2115:11       AnalysisContextImpl.recordResolveDartLibraryTaskResults
package:analyzer/src/generated/engine.dart 5304:133      AnalysisContextImpl_AnalysisTaskResultRecorder.visitResolveDartLibraryTask
package:analyzer/src/generated/engine.dart 14327:77      ResolveDartLibraryTask.accept
package:analyzer/src/generated/engine.dart 6732:18       AnalysisTask.perform
package:analyzer/src/generated/engine.dart 2414:86       AnalysisContextImpl._cacheDartResolutionData
package:analyzer/src/generated/engine.dart 3046:41       AnalysisContextImpl._getDartResolutionData
package:analyzer/src/generated/engine.dart 3077:36       AnalysisContextImpl._getDartResolutionData2
package:analyzer/src/generated/engine.dart 1192:81       AnalysisContextImpl.computeLibraryElement
package:code_transformers/src/resolver_impl.dart 157:46  ResolverImpl._performResolve.<fn>.<fn>
dart:_internal                                           ListIterable.toList
package:code_transformers/src/resolver_impl.dart 158:16  ResolverImpl._performResolve.<fn>
dart:isolate                                             _RawReceivePortImpl._handleMessage
Build completed with 2 errors.

更新 pubspec.yaml文件的内容是:

name: ProjectName
version: 0.1.1
description: "desc..."
environment:
  sdk: '>=1.0.0 <2.0.0'
dependencies:
  angular: 1.1.0
  browser: any
  crypto: any
#  polymer_highcharts: any
transformers:
- angular

操作系统是Windows 10.它适用于Windows 8和Ubuntu 14.04,适用于Dart SDK的1.9.1 - &gt; 1.12.2,但不是1.13.1(与上述类似的问题)

1 个答案:

答案 0 :(得分:1)

这是 code_transformer 包的已知问题。请参阅 Dart SDK issue 25009 angular.dart issue 1743