English 中文(简体)
pub pub build build
原标题:flutter pub run build_runner build is Deprecated

当我跑到<条码>面粉末管面时,我发现这一错误:

Deprecated. Use `dart run` instead.
[INFO] Generating build script completed, took 169ms
[WARNING] ../../../.pub-cache/hosted/pub.dev/built_value_generator-8.6.1/lib/src/dart_types.dart:65:21: Error:  InvalidType  isn t a type.
    if (dartType is InvalidType) {
                    ^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/built_value_generator-8.6.1/lib/src/value_source_class.dart:497:20: Error: The getter  name2  isn t defined for the class  NamedType .
 -  NamedType  is from  package:analyzer/dart/ast/ast.dart  ( ../../../.pub-cache/hosted/pub.dev/analyzer-5.7.1/lib/dart/ast/ast.dart ).
Try correcting the name to the name of an existing getter, or defining a getter or field named  name2 .
          if (type.name2.lexeme ==  Built ) {
                   ^^^^^
[INFO] Precompiling build script... completed, took 547ms
[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.

因此,我操作了<条码>dart ,建造了_runner Building——delete-conflicting-outputs,我发现这一错误:

[INFO] Generating build script completed, took 172ms
[WARNING] ../../../.pub-cache/hosted/pub.dev/built_value_generator-8.6.1/lib/src/dart_types.dart:65:21: Error:  InvalidType  isn t a type.
    if (dartType is InvalidType) {
                    ^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/built_value_generator-8.6.1/lib/src/value_source_class.dart:497:20: Error: The getter  name2  isn t defined for the class  NamedType .
 -  NamedType  is from  package:analyzer/dart/ast/ast.dart  ( ../../../.pub-cache/hosted/pub.dev/analyzer-5.7.1/lib/dart/ast/ast.dart ).
Try correcting the name to the name of an existing getter, or defining a getter or field named  name2 .
          if (type.name2.lexeme ==  Built ) {
                   ^^^^^
[INFO] Precompiling build script... completed, took 570ms
[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.

我尝试添加<条码>gql:0.13<>/条码>,以便依赖性-over干,但我再次发现同样的错误!

I m using Flutter (Channel persistent, 3.10.5, on macOS 13.2.1 22D68 darwin-arm64, locale en-US) and build_runner: ^2.4.5

我如何确定这一点?

最佳回答

您可尝试通过修改<条码>pubsec>yaml将<条码>升至最新版本(目前为2.4.8)。

dev_dependencies:
...
build_runner: ^2.4.8
...

flutter pub upgrade build_runner

此外,还应通过使用冲积层来清理所有 flu。

flutter clean

If it doesn t solve your problem, you will try

dart run build_runner doct或

to get m或e inf或mations about this err或.

问题回答

Delete the first pubspec.lock file.

then flutter clean flutter pubget

www.un.org/Depts/DGACM/index_spanish.htm 因此,它将产生网络,如dart和pubspec.lock file。

共和国经营的冲洗建筑





相关问题
Flutter App cannot be installed on Android TV

I m building a Flutter app that should support Android TV and Mobile devices. Despite Google Play shows that it is supported, I cannot install app on my MiBox device. While trying to install it, both ...

Moving the icon button to the right causes rendering issues

I am trying to align the icon button to the right of the Text field, I tried the row which made the icon button not centered vertically and now I am trying out the Stack widget. Here is my code - ...

热门标签