fluttercommunity / rx_command

RxCommand - Reactive event handler wrapper class inspired by ReactiveUI. Maintainer @escamoteur
https://pub.dev/packages/rx_command
MIT License
134 stars 19 forks source link

Error: The getter 'value' isn't defined for the class 'Notification<TResult>'. #51

Closed rednikisfun closed 3 years ago

rednikisfun commented 3 years ago

When I try to run the app on an Android device, I encounter an error:

/C:/Users/redni/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/rx_command-5.3.0/lib/rx_command.dart:559:44: Error: The getter 'value' isn't defined for the class 'Notification<TResult>'.
 - 'Notification' is from 'package:rxdart/src/utils/notification.dart' ('/C:/Users/redni/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/rxdart-0.26.0/lib/src/utils/notification.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'value'.
          _resultsSubject.add(notification.value);
                                           ^^^^^
/C:/Users/redni/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/rx_command-5.3.0/lib/rx_command.dart:560:65: Error: The getter 'value' isn't defined for the class 'Notification<TResult>'.

 - 'Notification' is from 'package:rxdart/src/utils/notification.dart' ('/C:/Users/redni/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/rxdart-0.26.0/lib/src/utils/notification.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'value'.
         _commandResultsSubject.add(CommandResult(notification.value, null, true));
                                                                ^^^^^
/C:/Users/redni/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/rx_command-5.3.0/lib/rx_command.dart:561:37: Error: The getter 'value' isn't defined for the class 'Notification<TResult>'.
 - 'Notification' is from 'package:rxdart/src/utils/notification.dart' ('/C:/Users/redni/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/rxdart-0.26.0/lib/src/utils/notification.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'value'.
          lastResult = notification.value;
                                    ^^^^^
2

FAILURE: Build failed with an exception.

* Where:
Script 'E:\SDKs\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'E:\SDKs\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 35s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Flutter doctor output:


Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.4, on Microsoft Windows [Version 10.0.19042.867], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] Connected device (3 available)

Pubspec:

name: new_flowers
description: New Flowers

version: 1.0.15+15

environment:
  sdk: ">=2.6.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  #Generic
  cupertino_icons: ^1.0.2
  built_value: ^8.0.4
  built_collection: ^5.0.0
  provider: ^5.0.0
  rxdart: ^0.25.0
  rx_command: ^5.3.0
  intl: ^0.17.0
  oktoast: ^3.0.0
  tuple: ^2.0.0
  url_launcher: ^6.0.3
  crypto: ^3.0.1
  flutter_linkify: ^5.0.0
  shared_preferences: ^2.0.5
  file_picker_cross: ^4.3.2

  #Mobile
  cloud_firestore: ^1.0.4
  firebase_auth: ^1.0.2
  google_sign_in: ^5.0.1
  cached_network_image: ^3.0.0
  dio: ^4.0.0
  webview_flutter: ^2.0.4
  open_file: ^3.1.0
  path_provider: ^2.0.1
  firebase_messaging: ^9.1.1
  transparent_image: ^2.0.0
  package_info: ^2.0.0

  characters: ^1.1.0

  #Web
  firebase: ^9.0.1
  spreadsheet_decoder: ^2.0.0

dependency_overrides:
  firebase_auth_web: ^1.0.5
  intl: ^0.17.0
  flutter_cache_manager: ^3.0.0-nullsafety.0
  rxdart: ^0.26.0-nullsafety.1

dev_dependencies:
  build_runner: ^1.12.2
  built_value_generator: ^8.0.4
  flutter_launcher_icons: ^0.9.0

flutter_icons:
  android: true
  ios: true
  image_path: "assets/big_icon.jpg"
  image_path_android: "assets/big_icon.png"
  image_path_ios: "assets/big_icon.jpg"

#  flutter_test:
#    sdk: flutter

flutter:
  uses-material-design: true

  assets:
    - assets/
rednikisfun commented 3 years ago

Closing the issue as the dependency conflicts were the cause. ex_command 5.3.0 was not compatible with overridden rxdart ^0.26.0-nullsafety.1