auto_route_library icon indicating copy to clipboard operation
auto_route_library copied to clipboard

Bad state: Future already completed

Open koral-- opened this issue 2 years ago • 47 comments

This is an anonymous automated crash report.

StateError: Bad state: Future already completed
  File "future_impl.dart", line 44, in _AsyncCompleter.complete
  File "navigator.dart", line 360, in Route.didComplete
  File "navigator.dart", line 338, in Route.didPop
  File "routes.dart", line 71, in OverlayRoute.didPop
  File "routes.dart", line 262, in TransitionRoute.didPop
  File "routes.dart", line 669, in LocalHistoryRoute.didPop
  File "auto_route_navigator.dart", line 73, in _AutoRouteNavigatorState.build.<fn>
  File "navigator.dart", line 4892, in NavigatorState.pop
  File "navigator.dart", line 4933, in NavigatorState.popUntil
  File "routing_controller.dart", line 921, in StackRouter.popUntil
  File "routing_controller.dart", line 1170, in StackRouter.popUntilRouteWithName

Affected line in my code: AutoRouter.of(context).popUntilRouteWithName(<SomePage>Route.name); It is the loader (modal dialog) hiding, invoked from the cubit listener. However, emissions won't occur if the cubit is closed. I've tried inserting the artificial delays to simulate some race conditions eg. pop the page from which context is taken just before calling popUntilRouteWithName but I could not reproduce any exception so I guess there is a bug in this library.

auto_route: 3.2.4 flutter 2.8.3 Android 12

koral-- avatar Mar 22 '22 16:03 koral--

@koral-- Not sure what's going on here, popUntilRouteWithName is just a helper function that calls popUntil on the native NavigatorState so there isn't much code on my side. any idea how this can be reproduced?

Milad-Akarie avatar Apr 09 '22 13:04 Milad-Akarie

any idea how this can be reproduced?

No. I described what I've tried:

I've tried inserting the artificial delays to simulate some race conditions eg. pop the page from which context is taken just before calling popUntilRouteWithName but I could not reproduce any exception so I guess there is a bug in this library.

However, I was not able to reproduce that.

koral-- avatar Apr 10 '22 17:04 koral--

Future already completed. Error thrown null.
       at _AsyncCompleter.complete(_AsyncCompleter.java)
       at Route.didComplete(navigator.dart:360)
       at Route.didPop(navigator.dart:338)
       at OverlayRoute.didPop(routes.dart:72)
       at TransitionRoute.didPop(routes.dart:263)
       at LocalHistoryRoute.didPop(routes.dart:670)
       at _AutoRouteNavigatorState.build.<fn>(auto_route_navigator.dart:73)
       at NavigatorState.pop(navigator.dart:4900)
       at NavigatorState.popUntil(navigator.dart:4941)
       at StackRouter.popUntil(routing_controller.dart:921)
       at StackRouter.pushAndPopUntil(routing_controller.dart:1123)

In my firebase, there are errors like this

vimaxwell avatar Jun 22 '22 08:06 vimaxwell

@Milad-Akarie , I got these kind of errors when using structures like:

try {
  // some code that might fail
  myFunc().then(processValue).catchError(handleError);
  // some other code that might fail
} catch(e) {
  // do something on error
}

Combining structures like try...catch and ().then...catchError together might be the culprit for these errors. I solved it on my side by sticking to the try...catch only.

Constans avatar Jun 22 '22 08:06 Constans

@Milad-Akarie I have the same thing happen when quickly switching child tabs in the bottom navigation

`I/flutter (21852): ----------------FIREBASE CRASHLYTICS---------------- I/flutter (21852): 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 2849 pos 18: '!navigator._debugLocked': is not true. I/flutter (21852): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61) I/flutter (21852): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5) I/flutter (21852): #2 _RouteEntry.handlePush. (package:flutter/src/widgets/navigator.dart:2849:18) I/flutter (21852): #3 TickerFuture.whenCompleteOrCancel.thunk (package:flutter/src/scheduler/ticker.dart:420:15) I/flutter (21852): #4 _rootRunUnary (dart:async/zone.dart:1399:47) I/flutter (21852): #5 _CustomZone.runUnary (dart:async/zone.dart:1300:19) I/flutter (21852): #6 _FutureListener.handleError (dart:async/future_impl.dart:165:22) I/flutter (21852): #7 Future._propagateToListeners.handleError (dart:async/future_impl.dart:778:47) I/flutter (21852): #8 Future._propagateToListeners (dart:async/future_impl.dart:799:13) I/flutter (21852): #9 Future._completeError (dart:async/future_impl.dart:574:5) I/flutter (21852): #10 Future._asyncCompleteError. (dart:async/future_impl.dart:665:7) I/flutter (21852): #11 _rootRun (dart:async/zone.dart:1391:13) I/flutter (21852): #12 _CustomZone.run (dart:async/zone.dart:1293:19) I/flutter (21852): #13 _CustomZone.runGuarded (dart:async/zone.dart:1201:7) I/flutter (21852): ----------------------------------------------------

======== Exception caught by gesture =============================================================== The following StateError was thrown while handling a gesture: Bad state: Future already completed

When the exception was thrown, this was the stack: #1 Route.didComplete (package:flutter/src/widgets/navigator.dart:360:19) #2 Route.didPop (package:flutter/src/widgets/navigator.dart:338:5) #3 OverlayRoute.didPop (package:flutter/src/widgets/routes.dart:72:36) #4 TransitionRoute.didPop (package:flutter/src/widgets/routes.dart:267:18) #5 LocalHistoryRoute.didPop (package:flutter/src/widgets/routes.dart:700:18) #6 _AutoRouteNavigatorState.build. (package:auto_route/src/router/widgets/auto_route_navigator.dart:74:26) #7 NavigatorState.pop (package:flutter/src/widgets/navigator.dart:4957:28) #8 NavigatorState.popUntil (package:flutter/src/widgets/navigator.dart:5000:7) #9 StackRouter.popUntilRoot (package:auto_route/src/router/controller/routing_controller.dart:999:33) #10 _MainPageState._onSetActiveIndex (package:df_platform/pages/main_page/main_page.dart:35:45) #11 _MainPageState.build.. (package:df_platform/pages/main_page/main_page.dart:71:13) #12 NavigationBar._handleTap. (package:flutter/src/material/navigation_bar.dart:150:37) #13 _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1072:21) #14 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:253:24) #15 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:627:11) #16 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:306:5) #17 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:276:7) #18 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:163:27) #19 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:464:20) #20 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:440:22) #21 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:337:11) #22 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:395:7) #23 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:357:5) #24 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:314:7) #25 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:295:7) #29 _invoke1 (dart:ui/hooks.dart:169:10) #30 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:341:7) #31 _dispatchPointerDataPacket (dart:ui/hooks.dart:94:31) (elided 4 frames from dart:async) Handler: "onTap" Recognizer: TapGestureRecognizer#e7400 debugOwner: GestureDetector state: ready won arena finalPosition: Offset(201.8, 813.1) finalLocalPosition: Offset(70.9, 42.2) button: 1 sent tap down`

olegys avatar Sep 29 '22 12:09 olegys

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar Nov 29 '22 08:11 github-actions[bot]

This issue should not be closed automatically. There is neither a solution nor explicit statement that it is not a bug in this library (or it is not feasible to fix this).

koral-- avatar Nov 29 '22 10:11 koral--

@koral-- as stated before it's not clear how to reproduce this bug, do you have any updates regarding this?

Milad-Akarie avatar Nov 29 '22 11:11 Milad-Akarie

I have more occurrences logged from anonymous crash reports (along with breadcrumbs containing the navigation history) and they seems to be similar to @olegys written above. Eg. there are 3 pops and 1 push in the same second and finally the following exception:

StateError: Bad state: Future already completed
  File "future_impl.dart", line 35, in _AsyncCompleter.complete
  File "navigator.dart", line 360, in Route.didComplete
  File "navigator.dart", line 338, in Route.didPop
  File "routes.dart", line 72, in OverlayRoute.didPop
  File "routes.dart", line 267, in TransitionRoute.didPop
  File "routes.dart", line 700, in LocalHistoryRoute.didPop
  File "auto_route_navigator.dart", line 74, in _AutoRouteNavigatorState.build.<fn>
  File "navigator.dart", line 4957, in NavigatorState.pop
  File "navigator.dart", line 5000, in NavigatorState.popUntil
  File "routing_controller.dart", line 1016, in StackRouter.popUntil
  File "routing_controller.dart", line 1226, in StackRouter.pushAndPopUntil

So it looks like some race condition. E.g. Some async function(s) may be executed in parallel instead of sequentially.

koral-- avatar Nov 29 '22 12:11 koral--

I probably got the same problem. In my situation it happens, when the app is launched by a password recovery link. Then pushAndPopUntil is called twice in quick succession.

This scenario throws an exception:

   appRouter.pushAndPopUntil(const AuthRouter(children: [SignInRoute()]), predicate: (route) => false);
   
   Event gets fetched instantly by a listener in SignInPage
   
   appRouter.pushAndPopUntil(const AuthRouter(children: [VerifyRoute()]), predicate: (route) => false);

When adding a delay of 1000ms before listening for the event, everything works fine. Just waiting 100-200ms is not enough strangely.

Stack Trace in release

StateError: Bad state: Future already completed
  File "future_impl.dart", line 35, in _AsyncCompleter.complete
  File "navigator.dart", line 360, in Route.didComplete
  File "navigator.dart", line 338, in Route.didPop
  File "routes.dart", line 72, in OverlayRoute.didPop
  File "routes.dart", line 267, in TransitionRoute.didPop
  File "routes.dart", line 700, in LocalHistoryRoute.didPop
  File "auto_route_navigator.dart", line 74, in AutoRouteNavigatorState.build.<fn>
  File "navigator.dart", line 4957, in NavigatorState.pop
  File "navigator.dart", line 5000, in NavigatorState.popUntil
  File "routing_controller.dart", line 1016, in StackRouter.popUntil
  File "routing_controller.dart", line 1226, in StackRouter.pushAndPopUntil
  File "app_widget.dart", line 98, in AppWidget.build.<fn>.<fn>
  File "auth_service.freezed.dart", line 714, in _$_Recovery.maybeWhen
  File "app_widget.dart", line 78, in AppWidget.build.<fn>
  File "zone.dart", line 1598, in _RootZone.runBinaryGuarded
  File "element.dart", line 532, in ProviderElementBase._notifyListeners.<fn>
  File "member_failure.freezed.dart", line 149, in _$_NoConnection.map
  File "element.dart", line 529, in ProviderElementBase._notifyListeners
  File "element.dart", line 150, in ProviderElementBase.setState
  File "notifier.dart", line 41, in NotifierBase.state=

Stack trace in debug

_AssertionError: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 3508 pos 12: '!_debugLocked': is not true.
  File "errors_patch.dart", line 51, col 61, in _AssertionError._doThrowNew
  File "errors_patch.dart", line 40, col 5, in _AssertionError._throwNew
  File "navigator.dart", line 3508, col 12, in NavigatorState.dispose
  File "framework.dart", line 5105, col 11, in StatefulElement.unmount
  File "framework.dart", line 1917, col 13, in _InactiveElements._unmount
  File "iterable.dart", line 39, col 13, in ListIterable.forEach
  File "framework.dart", line 1926, col 25, in _InactiveElements._unmountAll
  File "framework.dart", line 2523, col 15, in BuildOwner.lockState
  File "framework.dart", line 2947, col 7, in BuildOwner.finalizeTree
  File "binding.dart", line 885, col 19, in WidgetsBinding.drawFrame
  File "binding.dart", line 378, col 5, in RendererBinding._handlePersistentFrameCallback
  File "binding.dart", line 1175, col 15, in SchedulerBinding._invokeFrameCallback
  File "binding.dart", line 1104, col 9, in SchedulerBinding.handleDrawFrame
  File "binding.dart", line 1015, col 5, in SchedulerBinding._handleDrawFrame
  File "hooks.dart", line 148, col 13, in _invoke
  File "platform_dispatcher.dart", line 318, col 5, in PlatformDispatcher._drawFrame
  File "hooks.dart", line 115, col 31, in _drawFrame

auto_route: 5.0.2 auto_route_generator: 5.0.3 flutter 3.3.6 Android 12

redarflap avatar Jan 05 '23 00:01 redarflap

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar Mar 07 '23 08:03 github-actions[bot]

This issue should be exempted from autoclosing until there is some change.

koral-- avatar Mar 07 '23 09:03 koral--

Getting the same issue when using pushAndPopUntil inside a BlocListener to logout the user:

context.router.pushAndPopUntil( const OnBoardingRoute(), predicate: (_) => false, );

Using:

  auto_route: ^6.4.0
  auto_route_generator: ^6.2.0
  build_runner: ^2.3.3

PS: this was also happening in V5.0.4, So i migrated to V6.4.0 but the issue kept happening.

Flutter Doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.7.12, on Microsoft Windows [Version 10.0.22621.1555], locale en-AS)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2022.1)
[√] IntelliJ IDEA Ultimate Edition (version 2022.3)
[√] Connected device (4 available)
[√] HTTP Host Availability
#0

_ AsyncCompleter.complete (dart:async/

future_impl.dart:35)

#1

Route.didComplete (package:flutter/src/widgets/

navigator.dart:362)

_RouteEntry.handleComplete (package:flutter/src/

#2

widgets/navigator.dart:2963)

#3

NavigatorState.flushHistoryUpdates

(package:flutter/src/widgets/navigator.dart:3980)

#4

NavigatorState._updatePages (package:flutter/src/

widgets/navigator.dart:5879)

Navigator State.didUpdateWidget (package:flutter/

#5

srC/widgets/navigator.dart:3530)

StatefulElement.update (package:flutter/src/

#6

widgets/framework.dart:5142)

#7

Element.updateChild (package:flutter/src/ widgets/

framework.dart:3660)

#8£ ComponentElement.performRebuild

(package:flutter/src/widgets/framework.dart:4993)

StatefulElement.performRebuild (package:flutter/

#9

src/ widgets/framework.dart:5133)

#10 E ement.rebuild (package:flutter/src/widgets/

framework.dart:4690)

#11 StatefulElement.update (package:flutter/src/

widgets/framework.dart:5156)

#12

Element.updateChild (package:flutter/src/widgets/

framework.dart:3660)

#13 ComponentElement.performRebuild

(package:flutter/src/widgets/framework.dart:4993)

#14 Element.rebuild (package:flutter/src/ widgets/

framework.dart:4690)

roxyElement.update (package:flutter/src/widgets/

#15

framework.dart:5301)

#16

Element.updateChild (package:flutter/src/widgets/

framework.dart:3660)

#17 ComponentElement.performRebuild

(package:flutter/src/widgets/framework.dart:4993)

#18

Element.rebuild (package:flutter/src/widgets/

framework.dart:4690)

ProxyElement.update (package:flutter/src/widgets/

#19

framework.dart:5301)

#20 Element.updateChild (package:flutter/src/

ProxyElement.update (package:flutter/src/widgets/

#19

framework.dart:5301)

#20 Element.updateChild (package:flutter/src/ widgets/

framework.dart:3660)

#21 ComponentElement.performRebuild

(package:flutter/src/widgets/framework.dart:4993)

#22 StatefulElement.performRebuild (package:flutter/

src/widgets/framework.dart:5133)

#23

Element.rebuild (package:flutter/src/ widgets/

framework.dart:4690)

#24 StatefulElement.update (package:flutter/src/

widgets/framework.dart:5156)

#25 Element.updateChild (package:flutter/src/widgets/

framework.dart:3660)

#26 ComponentElement.performRebuild

(package:flutter/src/widgets/framework.dart:4993)

#27 Element.rebuild (package:flutter/src/widgets/

framework.dart:4690)

#28 StatelessElement.update (package:flutter/ src/

widgets/framework.dart:5044)

Element.updateChild (package:flutter/src/widgets/

#29

framework.dart:3660)

ComponentElement.performRebuild

#30

(package:flutter/src/widgets/framework.dart:4993)

#31 Element.rebuild (package:flutter/src/widgets/

framework.dart:4690)

#32 ProxyElement.update (package:flutter/src/widgets/

framework.dart:5301)

Element.updateChild (package:flutter/src/widgets/

#33

framework.dart:3660)

#34

ComponentElement.performRebuild

(package:flutter/src/widgets/framework.dart:4993)

#35

Element.rebuild (package:flutter/src/widgets/

framework.dart:4690)

ProxyElement.update (package:flutter/src/widgets/

#36

framework.dart:5301)

#37

Element.updateChild (package:flutter/src/widgets/

framework.dart:3660)

#38 ComponentElement.performRebuild

(package:flutter/src/widgets/framework.dart:4993)

StatefulElement.performRebuild (package:flutter/

#39

src/widgets/framework.dart:5133)

#40 Element.rebuild (package:flutter/src/ widgets/

framework.dart:4690)

#41

BuildOwner.buildScope (package:flutter/src/

widgets/framework.dart:2743)

#42£ WidgetsBinding.drawFrame (package:flutter/src/

widgets/binding.dart:863)

RendererBinding._handlePersistentFrameCalback

#43

(package:flutter/src/rendering/binding.dart:381)

#44 SchedulerBinding._invokeFrameCallback

(package:flutter/src/scheduler/binding.dart:1289)

#45 SchedulerBinding.handleDrawFrame

(package:flutter/src/scheduler/binding.dart:1218)

#46 Scheduler Binding._handleDrawFrame

(package:flutter/src/scheduler/binding.dart:1076)

#47 _invoke (dart:ui/hooks.dart:145)

#48 PlatformDispatcher._drawFrame (dart:ui/

platform_dispatcher.dart:338)

#49 _drawFrame (dart:ui/hooks.dart:112)

medyas avatar May 02 '23 15:05 medyas

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar Jul 02 '23 08:07 github-actions[bot]

https://github.com/Milad-Akarie/auto_route_library/issues/1005#issuecomment-1457865849

koral-- avatar Jul 02 '23 09:07 koral--

I don't have repro steps, but it would be super nice if this could be resolved. In my case it's happening when our offline detection kicks in and sees if it needs to navigate the user away from a page that requires an active connection. I just haven't been able to figure out exactly which part is causing it.

dmrickey avatar Aug 11 '23 16:08 dmrickey

Any update on this issue ?

tusharanchliyajain avatar Sep 11 '23 05:09 tusharanchliyajain

same issue is this fixed ?

appRouter.pushAndPopUntil(DashboardRoute(), predicate: (_) => false);

mrqaidi avatar Sep 11 '23 19:09 mrqaidi

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar Oct 12 '23 08:10 github-actions[bot]

https://github.com/Milad-Akarie/auto_route_library/issues/1005#issuecomment-1457865849

koral-- avatar Oct 12 '23 08:10 koral--

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar Nov 13 '23 08:11 github-actions[bot]

This issue should be exempted from autoclosing until there is some change

koral-- avatar Nov 13 '23 09:11 koral--

Also having this problem, I'm trying to use pushAndPopUntil and this happens:

I/flutter (17920): Bad state: Future already completed
I/flutter (17920): #0      _AsyncCompleter.complete (dart:async/future_impl.dart:41:31)
I/flutter (17920): #1      Route.didComplete (package:flutter/src/widgets/navigator.dart:362:19)
I/flutter (17920): #2      Route.didPop (package:flutter/src/widgets/navigator.dart:340:5)
I/flutter (17920): #3      OverlayRoute.didPop (package:flutter/src/widgets/routes.dart:77:36)
I/flutter (17920): #4      TransitionRoute.didPop (package:flutter/src/widgets/routes.dart:306:18)
I/flutter (17920): #5      LocalHistoryRoute.didPop (package:flutter/src/widgets/routes.dart:745:18)
I/flutter (17920): #6      AutoRouteNavigatorState.build.<anonymous closure> (package:auto_route/src/router/widgets/auto_route_navigator.dart:99:26)
I/flutter (17920): #7      NavigatorState.pop (package:flutter/src/widgets/navigator.dart:5045:28)
I/flutter (17920): #8      NavigatorState.popUntil (package:flutter/src/widgets/navigator.dart:5085:7)
I/flutter (17920): #9      StackRouter.popUntil (package:auto_route/src/router/controller/routing_controller.dart:1404:42)
I/flutter (17920): #10     StackRouter.pushAndPopUntil (package:auto_route/src/router/controller/routing_controller.dart:1680:13)

It's not everytime I tap the button (that calls the function), but happens a lot and those are the only logs on console.

babirms avatar Dec 12 '23 16:12 babirms

Hey folks, I created a repository where you can reproduce this error. https://github.com/artebiakin/auto_route_demo In my case, this happens when the request, for example after caching, is executed quickly. Therefore, the problem was floating in my case. How reproduce:

  1. Run the app
  2. Click to the "Redirect" button

I change my popAndPushAll in:

  void _redirectWithFix() => context.router
    ..removeLast()
    ..pushAll(const [
      FirstRoute(),
      SecondRoute(),
    ]);

This helps solve the problem.

artebiakin avatar Jan 09 '24 15:01 artebiakin

Hello, we're facing the same problem in our project when we call "popUntilRouteWithName" method. it sometimes happens, not very frequent but it would be nice to have a fix soon.

melWiss avatar Jan 09 '24 16:01 melWiss

@Milad-Akarie Were you able to look into this? We are currently using a workaround that introduces a fixed delay of 500ms before subsequent navigations. But that work around does cause obvious delays. Would appreciate if this can be either recognised as a defect or a solution is put forth

vivekkartha7 avatar Jan 22 '24 19:01 vivekkartha7

@Milad-Akarie It needs your attention

We have our app in production and we are facing this issue repeatedly. As you can see in the code below, we are not calling multiple push and pops in succession where we can delay subsequent navigation calls by some ms. Rather we are simply calling appRouter.popUntilRoot();. Crash comes from the last line here.

Code Example

  Future<void> loginAsGuest() async {
    if (state.valueOrNull?.isGuestUser ?? false) {
      unawaited(appRouter.pop());
    } else {
      final authRepository = ref.read(repositoryProvider).authReposiory;
      final appSettingsRepository =
          ref.read(repositoryProvider).appSettingsRepository;
      await authRepository.handshake();
      appSettingsRepository.saveFirstTimeAppOpen();
      state = AsyncValue.data(User.guest());
      appRouter.popUntilRoot();
    }
  }

Crash Log

# Crashlytics - Stack trace
# Platform: apple
# Version: 1.29.0 (29)
# Issue: 00a82426760396cd8398d17108e0527a
# Session: ef9c6261c21b4d98a324c18125507ee5_DNE_0_v2
# Date: Fri Jan 26 2024 12:00:30 GMT-0700 (Mountain Standard Time)

Fatal Exception: FlutterError
0  ???                            0x0 _AsyncCompleter.complete (dart:async)
1  ???                            0x0 Route.didComplete + 418 (navigator.dart:418)
2  ???                            0x0 Route.didPop + 396 (navigator.dart:396)
3  ???                            0x0 OverlayRoute.didPop + 77 (routes.dart:77)
4  ???                            0x0 TransitionRoute.didPop + 306 (routes.dart:306)
5  ???                            0x0 LocalHistoryRoute.didPop + 757 (routes.dart:757)
6  ???                            0x0 AutoRouteNavigatorState.build.<fn> + 74 (auto_route_navigator.dart:74)
7  ???                            0x0 NavigatorState.pop + 5245 (navigator.dart:5245)
8  ???                            0x0 NavigatorState.popUntil + 5285 (navigator.dart:5285)
9  ???                            0x0 StackRouter.popUntilRoot + 999 (routing_controller.dart:999)
10 ???                            0x0 GetSignedInUserNotifier.loginAsGuest + 53 (get_signed_in_user_provider.dart:53)

Crashed: com.apple.main-thread
0  FirebaseCrashlytics            0x214f4 FIRCLSProcessRecordAllThreads + 184
1  FirebaseCrashlytics            0x218d4 FIRCLSProcessRecordAllThreads + 1176
2  FirebaseCrashlytics            0x18a04 FIRCLSHandler + 48
3  FirebaseCrashlytics            0x12eb4 FIRCLSExceptionRecordOnDemand + 1328
4  FirebaseCrashlytics            0x128f4 FIRCLSExceptionRecordOnDemandModel + 228
5  FirebaseCrashlytics            0x20cc0 -[FIRCLSOnDemandModel recordOnDemandExceptionWithModel:] + 68
6  FirebaseCrashlytics            0x20720 -[FIRCLSOnDemandModel recordOnDemandExceptionIfQuota:withDataCollectionEnabled:usingExistingReportManager:] + 164
7  FirebaseCrashlytics            0x2eb34 -[FIRCrashlytics recordOnDemandExceptionModel:] + 140
8  Runner                         0x4f3ea0 -[FLTFirebaseCrashlyticsPlugin recordError:withMethodCallResult:] + 177 (FLTFirebaseCrashlyticsPlugin.m:177)
9  Runner                         0x4f375c -[FLTFirebaseCrashlyticsPlugin handleMethodCall:result:] + 101 (FLTFirebaseCrashlyticsPlugin.m:101)
10 Flutter                        0x5e1a38 InternalFlutterGpuTestClass_Method + 5940
11 Flutter                        0x43c00 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
12 libdispatch.dylib              0x26a8 _dispatch_call_block_and_release + 32
13 libdispatch.dylib              0x4300 _dispatch_client_callout + 20
14 libdispatch.dylib              0x12998 _dispatch_main_queue_drain + 984
15 libdispatch.dylib              0x125b0 _dispatch_main_queue_callback_4CF + 44
16 CoreFoundation                 0x3701c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
17 CoreFoundation                 0x33d28 __CFRunLoopRun + 1996
18 CoreFoundation                 0x33478 CFRunLoopRunSpecific + 608
19 GraphicsServices               0x34f8 GSEventRunModal + 164
20 UIKitCore                      0x22c62c -[UIApplication _run] + 888
21 UIKitCore                      0x22bc68 UIApplicationMain + 340
22 Runner                         0x99c8 main + 9 (AppDelegate.swift:9)
23 ???                            0x1b6102dcc (Missing)

Thread
0  libsystem_pthread.dylib        0x19fc start_wqthread + 438

com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x1178 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xf10 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xe28 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc68 mach_msg + 24
4  CoreFoundation                 0x35b1c __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x33a14 __CFRunLoopRun + 1208
6  CoreFoundation                 0x33478 CFRunLoopRunSpecific + 608
7  Foundation                     0x2c48c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8  Foundation                     0x5974c -[NSRunLoop(NSRunLoop) runUntilDate:] + 64
9  UIKitCore                      0x18e4a8 -[UIEventFetcher threadMain] + 420
10 Foundation                     0xafde0 __NSThread__start__ + 732
11 libsystem_pthread.dylib        0x24d4 _pthread_start + 136
12 libsystem_pthread.dylib        0x1a10 thread_start + 8

io.flutter.1.ui
0  libsystem_kernel.dylib         0x1178 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xf10 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xe28 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc68 mach_msg + 24
4  CoreFoundation                 0x35b1c __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x33a14 __CFRunLoopRun + 1208
6  CoreFoundation                 0x33478 CFRunLoopRunSpecific + 608
7  Flutter                        0x2e95e8 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
8  Flutter                        0x2e8c5c (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
9  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
10 libsystem_pthread.dylib        0x1a10 thread_start + 8

io.flutter.1.raster
0  libsystem_kernel.dylib         0x110c semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x4918 _dispatch_sema4_timedwait + 64
2  libdispatch.dylib              0x4f14 _dispatch_semaphore_wait_slow + 76
3  QuartzCore                     0x110ea8 CAMetalLayerPrivateNextDrawableLocked(CAMetalLayer*, CAMetalDrawable**, unsigned long*) + 968
4  QuartzCore                     0x110a74 -[CAMetalLayer nextDrawable] + 128
5  Flutter                        0x5ea4e0 InternalFlutterGpuTestClass_Method + 41436
6  Flutter                        0x3ebc30 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
7  Flutter                        0x3ec2c4 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
8  Flutter                        0x2e7734 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
9  Flutter                        0x3eb958 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
10 Flutter                        0x3eccbc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
11 Flutter                        0x3ec4fc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
12 Flutter                        0x404838 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
13 Flutter                        0x2e5d68 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
14 Flutter                        0x2e94fc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
15 CoreFoundation                 0xad3ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
16 CoreFoundation                 0xad094 __CFRunLoopDoTimer + 1004
17 CoreFoundation                 0x36c84 __CFRunLoopDoTimers + 288
18 CoreFoundation                 0x33c9c __CFRunLoopRun + 1856
19 CoreFoundation                 0x33478 CFRunLoopRunSpecific + 608
20 Flutter                        0x2e95e8 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
21 Flutter                        0x2e8c5c (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
22 libsystem_pthread.dylib        0x24d4 _pthread_start + 136
23 libsystem_pthread.dylib        0x1a10 thread_start + 8

io.flutter.1.io
0  libsystem_kernel.dylib         0x1178 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xf10 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xe28 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc68 mach_msg + 24
4  CoreFoundation                 0x35b1c __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x33a14 __CFRunLoopRun + 1208
6  CoreFoundation                 0x33478 CFRunLoopRunSpecific + 608
7  Flutter                        0x2e95e8 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
8  Flutter                        0x2e8c5c (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
9  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
10 libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.1
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 _pthread_cond_wait + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.2
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 _pthread_cond_wait + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.3
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 _pthread_cond_wait + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.4
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 _pthread_cond_wait + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.5
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 _pthread_cond_wait + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.6
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 _pthread_cond_wait + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

dart:io EventHandler
0  libsystem_kernel.dylib         0xef0c kevent + 8
1  Flutter                        0x5a1ed4 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
2  Flutter                        0x5cf9c8 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
3  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
4  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.1
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 _pthread_cond_wait + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.2
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 _pthread_cond_wait + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.3
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 _pthread_cond_wait + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.4
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 _pthread_cond_wait + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44da55553144a1f7c3e66c77eeff)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

Thread
0  libsystem_pthread.dylib        0x19fc start_wqthread + 438

Thread
0  libsystem_kernel.dylib         0x96d0 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x19b0 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1a04 start_wqthread + 8

com.google.firebase.crashlytics.MachExceptionServer
0  libsystem_kernel.dylib         0x1178 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xf10 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xe28 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc68 mach_msg + 24
4  FirebaseCrashlytics            0x1b040 FIRCLSMachExceptionServer + 104
5  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
6  libsystem_pthread.dylib        0x1a10 thread_start + 8

com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x1178 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xf10 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xe28 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc68 mach_msg + 24
4  CoreFoundation                 0x35b1c __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x33a14 __CFRunLoopRun + 1208
6  CoreFoundation                 0x33478 CFRunLoopRunSpecific + 608
7  CFNetwork                      0x25a060 estimatedPropertyListSize + 38188
8  Foundation                     0xafde0 __NSThread__start__ + 732
9  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
10 libsystem_pthread.dylib        0x1a10 thread_start + 8

DartWorker
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1000 _pthread_cond_wait + 1272
2  Flutter                        0x697558 InternalFlutterGpuTestClass_Method + 750164
3  Flutter                        0x6d2068 InternalFlutterGpuTestClass_Method + 990564
4  Flutter                        0x696f24 InternalFlutterGpuTestClass_Method + 748576
5  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
6  libsystem_pthread.dylib        0x1a10 thread_start + 8

DartWorker
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1000 _pthread_cond_wait + 1272
2  Flutter                        0x697558 InternalFlutterGpuTestClass_Method + 750164
3  Flutter                        0x6d2068 InternalFlutterGpuTestClass_Method + 990564
4  Flutter                        0x696f24 InternalFlutterGpuTestClass_Method + 748576
5  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
6  libsystem_pthread.dylib        0x1a10 thread_start + 8

Thread
0  libsystem_pthread.dylib        0x19fc start_wqthread + 438

Thread
0  libsystem_kernel.dylib         0x96d0 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x19b0 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1a04 start_wqthread + 8

DartWorker
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1000 _pthread_cond_wait + 1272
2  Flutter                        0x697558 InternalFlutterGpuTestClass_Method + 750164
3  Flutter                        0x62eef0 InternalFlutterGpuTestClass_Method + 322540
4  Flutter                        0x6d209c InternalFlutterGpuTestClass_Method + 990616
5  Flutter                        0x696f24 InternalFlutterGpuTestClass_Method + 748576
6  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
7  libsystem_pthread.dylib        0x1a10 thread_start + 8

DartWorker
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1000 _pthread_cond_wait + 1272
2  Flutter                        0x697558 InternalFlutterGpuTestClass_Method + 750164
3  Flutter                        0x6d2068 InternalFlutterGpuTestClass_Method + 990564
4  Flutter                        0x696f24 InternalFlutterGpuTestClass_Method + 748576
5  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
6  libsystem_pthread.dylib        0x1a10 thread_start + 8

DartWorker
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1000 _pthread_cond_wait + 1272
2  Flutter                        0x697558 InternalFlutterGpuTestClass_Method + 750164
3  Flutter                        0x6d2068 InternalFlutterGpuTestClass_Method + 990564
4  Flutter                        0x696f24 InternalFlutterGpuTestClass_Method + 748576
5  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
6  libsystem_pthread.dylib        0x1a10 thread_start + 8

DartWorker
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1000 _pthread_cond_wait + 1272
2  Flutter                        0x697558 InternalFlutterGpuTestClass_Method + 750164
3  Flutter                        0x6d2068 InternalFlutterGpuTestClass_Method + 990564
4  Flutter                        0x696f24 InternalFlutterGpuTestClass_Method + 748576
5  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
6  libsystem_pthread.dylib        0x1a10 thread_start + 8

SdxCoder avatar Jan 31 '24 15:01 SdxCoder

No workaround is working for us. We would appreciate if it can be fixed as soon as possible @Milad-Akarie .Thanks

SdxCoder avatar Jan 31 '24 15:01 SdxCoder

Hello @SdxCoder, sorry for not being active these days, I've being super busy. Any ways, popUntil uses Navigator.popUntil so debugging and fixing it might take sometime, however if your goal is to remove all routes and stack but the root you can try router.replaceAll([MyRootRoute]) or router.navigate(MyRootRoute])

Milad-Akarie avatar Feb 01 '24 06:02 Milad-Akarie

Hello @Milad-Akarie , I believe using router.replaceAll([MyRootRoute]) this will pop all the routes and push a new list of route here in this case as root route. I don't want the root route to get disposed and pushed again as we have state associted , this will dispose the state and logic wont work. Correct me if i'm wrong.

router.navigate(MyRootRoute) how this works? I believe it checks the top most route , if route is already present it doesn't push new on top, else it pushes a new route. I don't think it will remove all the routes above. Kindly guide me here.

SdxCoder avatar Feb 06 '24 20:02 SdxCoder