Build: NoSuchMethodError: The getter 'futureDynamicType' was called on null.

Created on 4 Oct 2019  路  4Comments  路  Source: dart-lang/build

Thank you for taking the time to file an issue!

In order to route, prioritize, and act on this as soon as possible please include:

  • Dart SDK Version (dart --version)
  • What package(s) from this repo you are using, and the version (i.e. build_runner 0.7.12)

    • _If you are not sure, try checking your pubspec.lock file._

  • What builder(s) you are using (or writing yourself). Try to give a short summary of what they do.
  • Whether you are using Windows, MacOSX, or Linux (if applicable)
  • Whether you are using Chrome, Safari, Firefox, Edge (if applicable)
  • Any other packages or constraints we should know about

Missing some or all of the above might make the issue take longer or be impossible to act on.


For general questions consider using Stack Overflow instead:
https://stackoverflow.com/questions/tagged/dart

Also consider our Gitter channel for light-weight/quick discussions:
https://gitter.im/dart-lang/build


needs info

Most helpful comment

Running pub upgrade installed [email protected] and solved the issue for me.

All 4 comments

Can you please add some of the other details we requested in the issue template?

What version of build_runner and analyzer are you using? Where and how does this error surface? Does it give you a longer stack trace you can paste here?

@natebosch I'm also getting the same error. It might be worth mentioning that I'm using Dart through Flutter.

I'm running Dart 2.6.0-dev.5.0 on Windows 10 (1903) with the packages [email protected], and [email protected].

I'm using the builder provided by json_serializable.

The command flutter pub run build_runner build results in the following:

[INFO] Generating build script...
[INFO] Generating build script completed, took 382ms

[WARNING] Deleted previous snapshot due to missing asset graph.
[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 2m 18s

[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 5.0s

[INFO] Checking for unexpected pre-existing outputs....
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms

[INFO] Running 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 'futureDynamicType' was called on null.
Receiver: null
Tried calling: futureDynamicType
dart:core                                                       Object.noSuchMethod
package:analyzer/src/dart/element/element.dart 6640:40          LibraryElementImpl.createLoadLibraryFunctionForLibrary
package:analyzer/src/dart/element/element.dart 6490:9           LibraryElementImpl.createLoadLibraryFunction
package:analyzer/src/summary/resynthesize.dart 339:24           SummaryResynthesizer.getLibraryElement.<fn>
dart:collection                                                 _LinkedHashMapMixin.putIfAbsent
package:analyzer/src/summary/resynthesize.dart 327:36           SummaryResynthesizer.getLibraryElement
package:analyzer/src/summary/resynthesize.dart 390:20           SummaryResynthesizer._buildTypeProvider
package:analyzer/src/summary/resynthesize.dart 178:5            new SummaryResynthesizer
package:analyzer/src/summary/package_bundle_reader.dart 351:9   new StoreBasedSummaryResynthesizer
package:analyzer/src/summary/package_bundle_reader.dart 327:26  ResynthesizerResultProvider.createResynthesizer
package:analyzer/src/summary/package_bundle_reader.dart 85:5    new InputPackagesResultProvider
package:analyzer/src/dart/analysis/library_context.dart 75:24   new LibraryContext
package:analyzer/src/dart/analysis/driver.dart 1612:29          AnalysisDriver._createLibraryContext
package:analyzer/src/dart/analysis/driver.dart 1556:26          AnalysisDriver._computeUnitElement
package:analyzer/src/dart/analysis/driver.dart 1158:34          AnalysisDriver.performWork
package:analyzer/src/dart/analysis/driver.dart 2145:24          AnalysisDriverScheduler._run
package:analyzer/src/dart/analysis/driver.dart 2075:5           AnalysisDriverScheduler.start
package:build_resolvers/src/analysis_driver.dart 55:13          analysisDriver
package:build_resolvers/src/resolver.dart 138:18                new AnalyzerResolvers
package:build_runner_core/src/generate/options.dart 192:19      BuildOptions.create
package:build_runner/src/generate/build.dart 85:36              build
package:build_runner/src/entrypoint/build.dart 28:24            BuildCommand.run
package:args/command_runner.dart 197:27                         CommandRunner.runCommand
package:args/command_runner.dart 112:25                         CommandRunner.run.<fn>
dart:async                                                      new Future.sync
package:args/command_runner.dart 112:14                         CommandRunner.run
package:build_runner/src/entrypoint/run.dart 24:31              run
.dart_tool\build\entrypoint\build.dart 22:22                    main

pub finished with exit code 1

Running pub upgrade installed [email protected] and solved the issue for me.

Closing as it appears a pub upgrade will fix things

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kevmoo picture kevmoo  路  6Comments

carlowenig picture carlowenig  路  3Comments

natebosch picture natebosch  路  5Comments

kentcb picture kentcb  路  7Comments

natebosch picture natebosch  路  8Comments