Skip to content
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

NoSuchMethodError: The method 'onActionConfirmed' was called on null. #38

Closed
hasimyerlikaya opened this issue Aug 11, 2019 · 9 comments
Closed

Comments

@hasimyerlikaya
Copy link

hasimyerlikaya commented Aug 11, 2019

I'm using a slack handler. Normal error message comes with such an error. What could be the reason?

Error:

NoSuchMethodError: The method 'onActionConfirmed' was called on null.
Receiver: null
Tried calling: onActionConfirmed(Instance of 'Report')

Stack trace:

#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:50:5)
#1 ReportMode.onActionConfirmed (package:catcher/model/report_mode.dart:19:23)
#2 SilentReportMode.requestAction (package:catcher/mode/silent_report_mode.dart:9:11)
#3 Catcher._reportError (package:catcher/core/catcher.dart:294:18)

#4 Catcher.reportCheckedError (package:catcher/core/catcher.dart:271:15)
#5 DijitalBasinApp.build (package:dijital_basin_app/main.dart:67:15)
#6 StatelessElement.build (package:flutter/src/widgets/framework.dart:3974:28)
#7 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3924:15)
#8 Element.rebuild (package:flutter/src/widgets/framework.dart:3721:5)
#9 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3907:5)
#10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3902:5)
#11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3084:14)
#12 Element.updateChild (package:flutter/src/widgets/framework.dart:2887:12)
#13 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:939:16)
#14 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:910:5)
#15 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:856:17)
#16 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2320:19)
#17 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:855:13)
#18 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:736:7)
#19 runApp (package:flutter/src/widgets/binding.dart:786:7)
#20 Catcher._setupErrorHooks. (package:catcher/core/catcher.dart:129:7)
#21 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
#22 Catcher._setupErrorHooks. (package:catcher/core/catcher.dart:128:14)
#23 _rootRun (dart:async/zone.dart:1124:13)
#24 _CustomZone.run (dart:async/zone.dart:1021:19)
#25 _runZoned (dart:async/zone.dart:1516:10)
#26 runZoned (dart:async/zone.dart:1500:12)
#27 Catcher._setupErrorHooks (package:catcher/core/catcher.dart:128:5)
#28 Catcher._configure (package:catcher/core/catcher.dart:55:5)
#29 new Catcher (package:catcher/core/catcher.dart:48:5)
#30 main (package:dijital_basin_app/main.dart:54:3)
#31 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
#32 main (package:dijital_basin_app/main.dart:21:12)
#33 _runMainZoned.. (dart:ui/hooks.dart:216:25)
#34 _rootRun (dart:async/zone.dart:1124:13)
#35 _CustomZone.run (dart:async/zone.dart:1021:19)
#36 _runZoned (dart:async/zone.dart:1516:10)
#37 runZoned (dart:async/zone.dart:1500:12)
#38 _runMainZoned. (dart:ui/hooks.dart:208:5)
#39 _startIsolate. (dart:isolate-patch/isolate_patch.dart:301:19)
#40 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)

@hasimyerlikaya
Copy link
Author

Ok. I found the problem.

@rockingdice
Copy link

... Can you share what's the reason? I met the same issue.

@rockingdice
Copy link

@jhomlala Hey could you look at this issue? I have to modify the codes:

  void onActionConfirmed(Report report) {
    _reportModeAction.onActionConfirmed(report);
  }

to

  void onActionConfirmed(Report report) {
    _reportModeAction?.onActionConfirmed(report);
  }

to continue the work.

@jhomlala
Copy link
Owner

Hi @rockingdice ! Can you provide example app with this bug? I think that your idea to solve this problem may be only temp fix for some deep bug. I would prefer debug it more deeply to understand the root of the problem. Please provide example app. Thank you.

@jhomlala jhomlala reopened this Aug 21, 2019
@hasimyerlikaya
Copy link
Author

When I encountered this problem, I created a manual error for the test. The reason I received an error was because I wrote this before the "return MaterialApp" line of the error I created. This problem was corrected when we moved the error test to another location.

@rockingdice
Copy link

I agree that fix is a temp solution. I'm pretty sure that the exception is thrown during the initialization of Catcher (my situation is building the App). I'll see if I can make a repro when I'm free.

@prondzyn
Copy link

I also have similar error from time to time:

Error:

NoSuchMethodError: The method 'handle' was called on null.
Receiver: null
Tried calling: handle()

Stack trace:

#0      Catcher.onActionConfirmed (package:catcher/core/catcher.dart:363)
#1      ReportMode.onActionConfirmed (package:catcher/model/report_mode.dart:21)
#2      DialogReportMode._onAcceptReportClicked (package:catcher/mode/dialog_report_mode.dart:62)
#3      DialogReportMode._buildCupertinoDialog.<anonymous closure> (package:catcher/mode/dialog_report_mode.dart:34)
#4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:779)
#5      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:862)
#6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182)
#7      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:504)
#8      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:297)
#9      BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:217)
#10     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:470)
#11     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76)
#12     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:117)
#13     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379)
#14     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:115)
#15     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101)
#16     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218)
#17     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198)
#18     GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156)
#19     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102)
#20     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86)
#21     _rootRunUnary (dart:async/zone.dart:1159)
#22     _CustomZone.runUnary (dart:async/zone.dart:1048)
#23     _CustomZone.runUnaryGuarded (dart:async/zone.dart:950)
#24     _invoke1 (dart:ui/hooks.dart:275)
#25     _dispatchPointerDataPacket (dart:ui/hooks.dart:184)

catcher version: 0.3.6

I think it is also related to manually reported error: Catcher.reportCheckedError(onError, null);, but I'm not sure where to find any clue about what can cause this issue... any ideas?

@jhomlala
Copy link
Owner

This error seems to be connected with your Catcher configuration. Did you tried to use Catcher before it was initalized? This error stack trace shows that there was no report handler configured. This may happend once you use Catcher.reportCheckedError before Catcher setup.

@prondzyn
Copy link

I think it is not the problem with configuration. I have something like that:

void main() {

  final CatcherOptions debugOptions = _catcherOptions(
    ...
  );
  final CatcherOptions releaseOptions = _catcherOptions(
    ...,
  );

  Catcher(
    _StatefulApp(),
    debugConfig: debugOptions,
    releaseConfig: releaseOptions,
  );
}

and the call is much later.

The problem occurs when my internet connection is very poor. First I'm getting SocketException: Failed host lookup: '...' (OS Error: No address associated with hostname, errno = 7), and later the null on Catcher.onActionConfirmed as listed above. Is it possible that this null is because Catcher has problems with connection with Slack inside SlackHandler, or something like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants