美文网首页
NoSuchMethodError: The getter 'i

NoSuchMethodError: The getter 'i

作者: 锐心凌志 | 来源:发表于2019-08-12 17:52 被阅读0次

    Flutter工程生成.g.dart文件执行flutter packages pub run build_runner build --delete-conflicting-outputs后出现错误:

    You have hit a bug in build_runner
    Please file an issue with reproduction steps at [https://github.com/dart-lang/build/issues](https://github.com/dart-lang/build/issues)
    
    so, my build environment:
    
    *   [2.0.0-edge.be6309690fd60284a87f3258a740c7c30efb1092 ] Dart SDK Version (`dart --version`)
    *   [build_runner ^0.10.0 ] What package(s) from this repo you are using, and the version (i.e. `build_runner 0.7.12`)
    *   [Just demo at [https://flutter.io/json/](https://flutter.io/json/) ] What builder(s) you are using (or writing yourself). Try to give a short summary of what they do.
    *   [ MacOS] Whether you are using Windows, MacOSX, or Linux (if applicable)
    *   [ iOS Simulator] Whether you are using Chrome, Safari, Firefox, Edge (if applicable)
    *   [dependencies:
        cupertino_icons: ^0.1.2
        transparent_image: ^0.1.0
        pull_to_refresh: ^1.1.5
        json_annotation: ^1.0.0
    
    dev_dependencies:
    flutter_test:
    sdk: flutter
    build_runner: ^0.10.0
    json_serializable: ^1.0.0
    ] Any other packages or constraints we should know about
    
    error message:
    
    NoSuchMethodError: The getter 'inputs' was called on null.
    Receiver: null
    Tried calling: inputs
    dart:core Object.noSuchMethod
    /Users/zhangxianqiangmacbook/.pub-cache/hosted/pub.flutter-io.cn/build_runner_core-0.3.1+5/lib/old-src/asset_graph/serialization.dart 58:20 _AssetGraphDeserializer.deserialize
    package:build_runner_core/old-src/asset_graph/graph.dart 42:48 new AssetGraph.deserialize
    package:build_runner_core/old-src/generate/build_definition.dart 209:38 _Loader._tryReadCachedAssetGraph.
    package:build_runner_core/old-src/logging/logging.dart 25:30 logTimedAsync
    package:build_runner_core/old-src/generate/build_definition.dart 207:12 _Loader._tryReadCachedAssetGraph
    package:build_runner_core/old-src/generate/build_definition.dart 79:28 _Loader.prepareWorkspace
    package:build_runner_core/old-src/generate/build_definition.dart 64:50 BuildDefinition.prepareWorkspace
    package:build_runner_core/old-src/generate/build_impl.dart 106:49 BuildImpl.create
    package:build_runner_core/old-src/generate/build_runner.dart 31:37 BuildRunner.create
    package:build_runner/old-src/generate/build.dart 105:35 build
    package:build_runner/old-src/entrypoint/build.dart 28:24 BuildCommand.run
    package:args/command_runner.dart 194:27 CommandRunner.runCommand
    package:args/command_runner.dart 109:29 CommandRunner.run.
    dart:async new Future.sync
    package:args/command_runner.dart 109:11 CommandRunner.run
    package:build_runner/old-src/entrypoint/run.dart 22:31 run
    .dart_tool/build/entrypoint/build.dart 18:22 main
    
    pub finished with exit code 1
    
    

    解决方案:

    deleted the /.dart_tool , then everything is okay

    删除工程下面的.dart_tool文件,.dart_tool文件夹默认是隐藏文件夹

    相关文章

      网友评论

          本文标题:NoSuchMethodError: The getter 'i

          本文链接:https://www.haomeiwen.com/subject/igfpjctx.html