[鈭歖 Flutter (Channel master, v1.10.7-pre.99, on Microsoft Windows [Version 10.0.18362.356], locale zh-TW)
[鈭歖 Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[鈭歖 Android Studio (version 3.3)
[鈭歖 VS Code, 64-bit edition (version 1.38.0)
[鈭歖 Connected device (1 available)
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 7053:40 LibraryElementImpl.createLoadLibraryFunctionForLibrary
package:analyzer/src/dart/element/element.dart 6903:9 LibraryElementImpl.createLoadLibraryFunction
package:analyzer/src/summary/resynthesize.dart 363:24 SummaryResynthesizer.getLibraryElement.<fn>
dart:collection _LinkedHashMapMixin.putIfAbsent
package:analyzer/src/summary/resynthesize.dart 351:36 SummaryResynthesizer.getLibraryElement
package:analyzer/src/summary/resynthesize.dart 414:20 SummaryResynthesizer._buildTypeProvider
package:analyzer/src/summary/resynthesize.dart 202:5 new SummaryResynthesizer
package:analyzer/src/summary/package_bundle_reader.dart 154:9 new StoreBasedSummaryResynthesizer
package:analyzer/src/dart/analysis/library_context.dart 100:27 new LibraryContext
package:analyzer/src/dart/analysis/driver.dart 1626:29 AnalysisDriver._createLibraryContext
package:analyzer/src/dart/analysis/driver.dart 1570:26 AnalysisDriver._computeUnitElement
package:analyzer/src/dart/analysis/driver.dart 1170:34 AnalysisDriver.performWork
package:analyzer/src/dart/analysis/driver.dart 2188:24 AnalysisDriverScheduler._run
package:build_resolvers/src/analysis_driver.dart 54: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
I thought It's the compatibility with my old build_runner version, but the issue isn't disappeared when I updated to the latest version(1.7.1).
For me, the workaround is downgrade to 1.10.1, and build_runner keep working (with latest version).
I believe you need the newest build_resolvers for this to work - analyzer changed its summary format which broke us (we can no longer use the summary provided by the sdk). The newest build_resolvers builds its own summary and uses that.
What?! I don't even know I need build_resolvers. I'm following the flutter's documentation. Is It outdated 馃槩?
You don't need to explicitly depend on build_resolvers - its a transitive dependency of build_runner. You should just need to do a pub upgrade (or flutter packages pub upgrade) to get the latest version.
In the output of that command it should show what version you got and if there is a newer version available what that is.
Hit a similar error, and running flutter pub upgrade did the trick for me.
Thanks @jakemac53
Thanks for the confirmation of the fix. Will close since this is resolved with a pub upgrade.
In my case, the solution does not work. I had done that, but everytime same error. https://github.com/flutter/flutter/issues/47437
Please help !!!
@shresthaRam you need at least builder_resolvers version 1.1.0. You probably aren't getting that for some reason (likely some analyzer constraint in some other dependency).
You can add this constraint to your pubspec to start tracking down why you can't get the latest version:
dependencies:
build_resolvers: ^1.1.0
Thanks for response.
Previously i had tried that, but it do not work. After that issue was related to other dependencies for my project. Now it is fixed.
Thank u again!!!!
Most helpful comment
You don't need to explicitly depend on
build_resolvers- its a transitive dependency ofbuild_runner. You should just need to do apub upgrade(orflutter packages pub upgrade) to get the latest version.In the output of that command it should show what version you got and if there is a newer version available what that is.