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 --version)build_runner 0.7.12)pubspec.lock file._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
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
Most helpful comment
Running
pub upgradeinstalled[email protected]and solved the issue for me.