通过对 dart 2 的更新,jaguar 序列化程序会导致问题。
我的设置是:
Flutter Channel 测试版,v0.2.8
pubspec.yaml
dependencies:
analyzer: "^0.31.2-alpha.1" ## i also tried to get the newest version
intl: "^0.15.4"
http: "^0.11.3+16"
great_circle_distance: "^1.0.1"
####jaguar_serializer: "^1.0.0-dev5"
jaguar_serializer: ^1.0.0-dev1
dev_dependencies:
build_runner: ^0.8.0
jaguar_serializer_cli: ^1.0.0-dev1
这是我收到的错误消息。似乎分析器包已更改..
DynamicTypeImpl 来自 package:analyzer/src/dart/element/type.dart
接口(interface)类型来自 package:analyzer/dart/element/type.dart
[SEVERE] jaguar_serializer_cli on lib/foundation/dart/logic/raw/RawType.dart:
Error running JaguarSerializerGenerator for nalisa_foundation|lib/foundation/dart/logic/raw/RawType.dart.
type 'DynamicTypeImpl' is not a subtype of type 'InterfaceType' in type cast where
DynamicTypeImpl is from package:analyzer/src/dart/element/type.dart
InterfaceType is from package:analyzer/dart/element/type.dart
[SEVERE] jaguar_serializer_cli on lib/foundation/dart/logic/Status.dart:
Error running JaguarSerializerGenerator for nalisa_foundation|lib/foundation/dart/logic/Status.dart.
type 'DynamicTypeImpl' is not a subtype of type 'InterfaceType' in type cast where
DynamicTypeImpl is from package:analyzer/src/dart/element/type.dart
InterfaceType is from package:analyzer/dart/element/type.dart
最佳答案
使用 jaguar_serialzier 2.2
。
dependencies:
analyzer: "^0.32.0"
intl: "^0.15.4"
http: "^0.11.3+16"
great_circle_distance: "^1.0.1"
jaguar_serializer: ^2.2.0
dev_dependencies:
build_runner: ^0.8.0
jaguar_serializer_cli: ^2.2.0
此外,Jaguar gitter channel 是提问的好地方。
关于flutter - 切换到 dart 2 会导致 jaguar 序列化程序出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49761546/