【问题标题】:SEVERE injectable_generator:injectable_builder ... type 'UnspecifiedInvalidResult' is not a subtype of type 'LibraryElementResult' in type castSEVERE injection_generator:injectable_builder ... 类型“UnspecifiedInvalidResult”不是类型转换中“LibraryElementResult”类型的子类型
【发布时间】:2021-10-10 06:17:01
【问题描述】:

在重构我的代码和执行 build_runner 时,我突然收到大量类似的错误

[SEVERE] injectable_generator:injectable_builder on lib/application/authorization/xxx data_sync/sync_data.dart (cached):

type 'UnspecifiedInvalidResult' is not a subtype of type 'LibraryElementResult' in type cast

可以看出,它们来自可注射包。

【问题讨论】:

    标签: flutter build-runner


    【解决方案1】:

    这是由目录名称中的空格引起的。我已将 xxx 预先添加到尚未重构的目录名称中。

    因此将xxx data_sync 更改为xxx_data_sync 解决了这个问题。有趣的部分是,我正在重构干净的架构,并在未来使用脏文件夹名称......

    【讨论】:

      猜你喜欢
      • 2021-09-24
      • 2020-05-30
      • 2021-10-22
      • 2023-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多