Skip to content

build_runner throws an error : NoSuchMethodError: The getter 'dependencies' was called on null #2569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
div3791 opened this issue Dec 10, 2019 · 1 comment · Fixed by #2592
Labels
needs-info Additional information needed from the issue author

Comments

@div3791
Copy link

div3791 commented Dec 10, 2019

flutter pub run build_runner build throws an error as bellow:

NoSuchMethodError: The getter 'dependencies' was called on null.
Receiver: null
Tried calling: dependencies
  Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
  findBuildConfigOverrides (package:build_runner/src/package_graph/build_config_overrides.dart:27:21)
<asynchronous suspension>
  _findBuilderApplications (package:build_runner/src/build_script_generate/build_script_generate.dart:66:13)
<asynchronous suspension>
  _generateBuildScript (package:build_runner/src/build_script_generate/build_script_generate.dart:28:26)
<asynchronous suspension>
  logTimedAsync (package:build_runner_core/src/logging/logging.dart:25:30)
<asynchronous suspension>
 generateBuildScript (package:build_runner/src/build_script_generate/build_script_generate.dart:25:5)
 generateAndRun (package:build_runner/src/build_script_generate/bootstrap.dart:49:31)
<asynchronous suspension>
  main (file:///Users/glorioleapps/Documents/Sdk/flutter/.pub-cache/hosted/pub.dartlang.org/build_runner-1.7.1/bin/build_runner.dart:77:30)
<asynchronous suspension>
  _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:303:32)
  _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
pub failed (255)

I am using hive_generator package.
here is pubspec.yaml:

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  flutter_svg: ^0.14.4
  device_preview: ^0.2.6
  rxdart: ^0.22.6
  data_connection_checker: ^0.3.4
  firebase_auth: ^0.14.0+8
  firebase_analytics: ^5.0.6
  flutter_facebook_login: ^3.0.0
  google_sign_in: ^4.0.11
  cloud_firestore: ^0.12.10+2
  firebase_core: ^0.4.2+1
  flutter_swiper: ^1.1.6
  dots_indicator: ^1.0.0
  flutter_slidable: ^0.5.4
  shared_preferences: ^0.5.4+3
  #Notificaiton Permission
  permission_handler: '^4.0.0'
  audioplayers: ^0.13.2
  text_to_speech_api: ^0.1.0
  hive: ^1.1.1
  hive_flutter: ^0.2.1
  get_it: ^3.0.3

dev_dependencies:
  flutter_test:
    sdk: flutter
  hive_generator: ^0.5.2
  build_runner: ^1.7.1

dependency_overrides:
  path_provider:
  analyzer:
@jakemac53
Copy link
Contributor

I believe this means you have a *.build.yaml file where the * is a package name that doesn't exist in your transitive deps.

We should provide a better error here though (or just warn and continue)

@jakemac53 jakemac53 added the needs-info Additional information needed from the issue author label Dec 11, 2019
@div3791 div3791 closed this as completed Jan 4, 2020
natebosch added a commit that referenced this issue Jan 7, 2020
Fixes #2569

When the user creates a `package.build.yaml` file, but `package` does
not exist as a dependency, warn and continue instead of dumping a stack
trace.
natebosch added a commit that referenced this issue Jan 7, 2020
Fixes #2569

When the user creates a `package.build.yaml` file, but `package` does
not exist as a dependency, warn and continue instead of dumping a stack
trace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Additional information needed from the issue author
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants