【问题标题】:Dart Web Development with firebase使用 Firebase 进行 Dart Web 开发
【发布时间】:2018-12-04 18:22:20
【问题描述】:

我是 dart web 开发的新手。我已经创建了入门应用程序并成功构建并提供了它。但是当我添加依赖项firebase时,我的构建失败了下面是错误

Creating build script, took 6540ms
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[WARNING] Throwing away cached asset graph because the build phases have changed. This most commonly would happen as a result of adding a new dependency or updating your dependencies.
[INFO] Cleaning up outputs from previous builds....
[INFO] Cleaning up outputs from previous builds. completed, took 130ms

[INFO] Reading cached asset graph completed, took 1.1s

[INFO] Checking for updates since last build...


You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues


NoSuchMethodError: The getter 'lastKnownDigest' was called on null.
Receiver: null
Tried calling: lastKnownDigest
dart:core                                                            Object.noSuchMethod
package:build_runner_core/src/generate/build_definition.dart 377:42  _Loader._computeBuilderOptionsUpdates.updateBuilderOptionsNode
package:build_runner_core/src/generate/build_definition.dart 387:33  _Loader._computeBuilderOptionsUpdates
package:build_runner_core/src/generate/build_definition.dart 290:20  _Loader._updateAssetGraph
package:build_runner_core/src/generate/build_definition.dart 89:17   _Loader.prepareWorkspace.<fn>
package:build_runner_core/src/logging/logging.dart 25:30             logTimedAsync
package:build_runner_core/src/generate/build_definition.dart 86:27   _Loader.prepareWorkspace
package:build_runner_core/src/generate/build_definition.dart 64:50   BuildDefinition.prepareWorkspace
package:build_runner_core/src/generate/build_impl.dart 105:49        BuildImpl.create
package:build_runner_core/src/generate/build_runner.dart 31:37       BuildRunner.create
package:build_runner/src/generate/build.dart 105:35                  build
package:build_runner/src/entrypoint/build.dart 28:24                 BuildCommand.run
package:args/command_runner.dart 196:27                              CommandRunner.runCommand
package:args/command_runner.dart 111:29                              CommandRunner.run.<fn>
dart:async                                                           new Future.sync
package:args/command_runner.dart 111:11                              CommandRunner.run
package:build_runner/src/entrypoint/run.dart 23:31                   run
.dart_tool/build/entrypoint/build.dart 133:22                        main

下面是我的 pubsec.yaml 文件。除了添加 firestore :x.x.x 依赖项之外,我在启动应用程序中没有更改任何内容

name: web_mytown
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com
# author: gaurav <email@example.com>

environment:
  sdk: '>=2.1.0 <3.0.0'

dependencies:
  angular: ^5.1.0
  angular_components: ^0.10.1
  firebase: ^5.0.2


dev_dependencies:
  angular_test: ^2.1.0
  build_runner: ^1.1.2
  build_test: ^0.10.3
  build_web_compilers: ^0.4.4
  test: ^1.5.1

【问题讨论】:

    标签: firebase web dart


    【解决方案1】:

    当我遇到这个错误时,问题是build_runner 版本。

    版本 0.10.0 工作:

    build_runner: ^0.10.0
    

    版本 1.0.0 产生了您所看到的错误

    我使用的教程中的示例1 产生了与您报告的相同的错误:

    build_runner: ^1.0.0
    

    显示错误:

    NoSuchMethodError: The getter 'lastKnownDigest' was called on null.
    

    看来问题出在build_runner 版本上。


    1. 在 GitHub 存储库中,pubspec.yaml 中 the tutorial I was usingbuild_runner 设置为 0.10.0

    【讨论】:

      猜你喜欢
      • 2020-03-22
      • 1970-01-01
      • 2014-09-10
      • 2011-01-30
      • 2010-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多