颤音:PubSpec.YAML分析仪和Injectable_generator版本以运行build_runner

发布于 2025-02-14 00:19:02 字数 929 浏览 0 评论 0原文

我不能使用build_runner: ^2.1.11在不添加Analyzer的情况下: ^4.2.0。添加时,可以生成build_runner文件,例如.g。 dart和冻结。但是,当涉及Injectable_generator时: ^1.5.3我什至无法将可注射的生成器添加到pubspec上,因为它显示了分析仪引起的错误。

我的需要:

  1. 运行flutter pub run build build_runner build - delete-conflicting-unputs而无需添加分析仪。 2.哪个版本的分析仪用于与Ingactable_runner兼容以支持build_runner。 3.是否有其他替代方法可以解决此问题以汇总Verison。

  2. 请检查我的pubsec文件,并分析其中的错误。

    依赖项: 分析仪: ^4.2.0 bordered_text: ^2.0.0 Cupertino_icons: ^1.0.2 达尔兹: ^0.10.1 dio: ^4.0.6 扑: SDK:颤抖 Flutter_Bloc: ^8.0.1 Freezed_annotation: ^2.0.3 get_it: ^7.2.0 Google_fonts: ^3.0.1 http: ^0.13.4 注射: ^1.5.3 json_annotation: ^4.5.0 json_serializable: ^6.3.0 Video_player: ^2.4.5

    dev_depentencies:

    build_runner: ^2.1.11 Flutter_lints: ^2.0.0 Flutter_test: SDK:颤抖 冷冻: ^2.0.4

I cant use build_runner: ^2.1.11 in flutter without adding analyzer: ^4.2.0.when its add it's possible to generate build_runner files like .g.dart and freezed.dart without any issues. but when it comes to injectable_generator: ^1.5.3 I can't even add injectable generator to the pubspec as it shows error due to analyzer.

My needs where about:

  1. Running flutter pub run build_runner build --delete-conflicting-outputs without adding analyzer.
    2.which version of analyzer is used to make compatible with injactable_runner to support for build_runner.
    3.Is there any alternative otpion to fix this issue to compine verisons.

  2. please check my pubsec file and analys e the error in it.

    dependencies:
    analyzer: ^4.2.0
    bordered_text: ^2.0.0
    cupertino_icons: ^1.0.2
    dartz: ^0.10.1
    dio: ^4.0.6
    flutter:
    sdk: flutter
    flutter_bloc: ^8.0.1
    freezed_annotation: ^2.0.3
    get_it: ^7.2.0
    google_fonts: ^3.0.1
    http: ^0.13.4
    injectable: ^1.5.3
    json_annotation: ^4.5.0
    json_serializable: ^6.3.0
    video_player: ^2.4.5

    dev_dependencies:

    build_runner: ^2.1.11
    flutter_lints: ^2.0.0
    flutter_test:
    sdk: flutter
    freezed: ^2.0.4

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荭秂 2025-02-21 00:19:02

您必须在pubspec.yaml:

dependency_overrides:
  analyzer: ^4.2.0

You must add dependency_overrides to your pubspec.yaml:

dependency_overrides:
  analyzer: ^4.2.0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文