Skip to content

[Google3 Bug]: Back button causes crash #168445

Description

@letramygoogle

EDIT by @matanlurey: This has nothing to do with the Flutter tool, it was a red herring. See #168445 (comment).


Help us understand the severity of this issue

  • causing severe production issues e.g. malfunctions or data loss
  • blocking next binary release
  • blocking a client feature launch within a quarter
  • nice-to-have but does not block a launch within the next quarter

Steps to reproduce

Crash report: b/416159318

It seems that the culprit is this Flutter roll cl/753573741

Expected results

App doesn't crash

Actual results

App crashed

Code sample

Not adding a minimal repro as not sure what caused the crash

Screenshots or Video

Attached in b/416159318

Logs

Attached in b/416159318

Flutter Doctor output

[   +2 ms] ProcessManager.runSync('which java')
[   +6 ms] executing: /usr/bin/adb devices -l
[        ] ProcessManager.run('/usr/bin/adb devices -l')
[        ] Gallium device polling: connecting to galliumd.
[        ] [✓] Flutter (Channel google3, on Debian GNU/Linux rodete 6.12.17-1rodete2-amd64, locale en_US.UTF-8) [0ms]
[        ]     • Framework revision 4a6965c4e6 (19 days ago), 2025-04-18T00:00:00.000
[        ]     • Engine revision 4a6965c4e6
[        ]     • Dart version 0cfefe2a03
[        ] [☠] Android toolchain - develop for Android devices (the doctor check crashed)
[        ]     ✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about
this issue
                 at https://github.com/flutter/flutter/issues.
[        ]     ✗ type 'Null' is not a subtype of type 'String' of 'executable'
[        ]     • #0      LocalProcessManager.canRun (package:process/src/interface/local_process_manager.dart:124)
[        ]       #1      getEmulatorVersion (package:flutter_tools/src/android/android_workflow.dart:64)
[        ]       #2      AndroidValidator.validateImpl (package:flutter_tools/src/android/android_workflow.dart:200)
[        ]       #3      DoctorValidator.validate (package:flutter_tools/src/doctor_validator.dart:58)
[        ]       #4      Doctor.startValidatorTasks.<anonymous closure> (package:flutter_tools/src/doctor.dart:244)
[        ]       #5      asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:109)
[        ]       #6      _rootRun (dart:async/zone.dart:1525)
[        ]       #7      _CustomZone.run (dart:async/zone.dart:1422)
[        ]       #8      _runZoned (dart:async/zone.dart:2033)
[        ]       #9      runZonedGuarded (dart:async/zone.dart:2019)
[        ]       #10     runZoned (dart:async/zone.dart:1952)
[        ]       #11     asyncGuard (package:flutter_tools/src/base/async_guard.dart:106)
[        ]       #12     Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:234)
[        ]       #13     Doctor.diagnose (package:flutter_tools/src/doctor.dart:372)
[        ]       #14     DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:59)
[        ]       #15     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1897)
[        ]       <asynchronous suspension>
[        ]       #16     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1551)
[        ]       <asynchronous suspension>
[        ]       #17     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154)
[        ]       <asynchronous suspension>
[        ]       #18     CommandRunner.runCommand (package:args/command_runner.dart:212)
[        ]       <asynchronous suspension>
[        ]       #19     FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:501)
[        ]       <asynchronous suspension>
[        ]       #20     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154)
[        ]       <asynchronous suspension>
[        ]       #21     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:438)
[        ]       <asynchronous suspension>
[        ]       #22     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:98)
[        ]       <asynchronous suspension>
[        ]       #23     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154)
[        ]       <asynchronous suspension>
[        ]       #24     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154)
[        ]       <asynchronous suspension>
[        ]       #25     run (package:mobile.flutter.cli/flutter_tools.dart:106)
[        ]       <asynchronous suspension>
[        ]       #26     main (google3:///mobile/flutter/cli/bin/cli_usage_aot.dart:4)
[        ]       <asynchronous suspension>
[        ] [✓] VS Code (version unknown) [0ms]
[        ]     • VS Code at /usr/share/code
[        ]     • Flutter extension can be installed from:
[        ]       🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[        ]     ✗ Unable to determine VS Code version.
[   +8 ms] List of devices attached
           localhost:38655        device product:lynx model:Pixel_7a device:lynx transport_id:13
[   +9 ms] Gallium device polling failed to connect to galliumd: gRPC Error (code: 14, codeName: UNAVAILABLE, message: Error connecting:
SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = localhost, port = 40890, details: null,
rawResponse: null, trailers: {})
[        ] /usr/bin/adb -s localhost:38655 shell getprop
[        ] ProcessManager.run('/usr/bin/adb -s localhost:38655 shell getprop')
[ +316 ms] ro.hardware = lynx
[        ] ro.build.characteristics = nosdcard
[        ] executing: uname -m
[        ] ProcessManager.runSync('uname -m')
[   +3 ms] Exit code 0 from: uname -m
[        ] x86_64
[        ] executing: /usr/bin/adb devices -l
[        ] ProcessManager.run('/usr/bin/adb devices -l')
[   +4 ms] List of devices attached
           localhost:38655        device product:lynx model:Pixel_7a device:lynx transport_id:13
[        ] [✓] Connected device (2 available) [347ms]
[        ]     • Pixel 7a (mobile) • localhost:38655 • android-arm64 • Android 13 (API 33)
[        ]     • Linux (desktop)   • linux           • linux-x64     • Debian GNU/Linux rodete 6.12.17-1rodete2-amd64
[        ] [✓] Google3 (on linux) [11ms]
[        ]     • KVM enabled
[        ] ! Doctor found issues in 1 category.
[        ] "flutter doctor" took 355ms.
[        ] Running 2 shutdown hooks
[        ] Shutdown hooks complete
[   +1 ms] exiting with code 0

Activity

  1. darshankawar commented on May 7, 2025

    @darshankawar
    Member

    @letramygoogle This seems similar to #167489 which was fixed couple of weeks ago. If you could try with latest master version to see if it resolves ?

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on May 7, 2025
  3. letramygoogle commented on May 8, 2025

    @letramygoogle
    Author

    Hi I have tried with the latest master version that's rolled into google3 and it seems that the issue is still reproducible.

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on May 8, 2025
  5. letramygoogle commented on May 8, 2025

    @letramygoogle
    Author

    Output from fg3 doctor when running fg3 but built from source

    [✓] Flutter (Channel google3, on Debian GNU/Linux rodete 6.12.17-1rodete2-amd64,
        locale en_US.UTF-8) [0ms]
        • Framework revision 4a6965c4e6 (20 days ago), 2025-04-18T00:00:00.000
        • Engine revision 4a6965c4e6
        • Dart version 0cfefe2a03
    
    [☠] Android toolchain - develop for Android devices (the doctor check crashed)
        ✗ Due to an error, the doctor check did not complete. If the error message
          below is not helpful, please let us know about this issue at
          https://github.com/flutter/flutter/issues.
        ✗ type 'Null' is not a subtype of type 'String' of 'executable'
        • #0      LocalProcessManager.canRun
          (package:process/src/interface/local_process_manager.dart:124)
          #1      getEmulatorVersion
          (package:flutter_tools/src/android/android_workflow.dart:64)
          #2      AndroidValidator.validateImpl
          (package:flutter_tools/src/android/android_workflow.dart:200)
          #3      DoctorValidator.validate
          (package:flutter_tools/src/doctor_validator.dart:58)
          #4      Doctor.startValidatorTasks.<anonymous closure>
          (package:flutter_tools/src/doctor.dart:244)
          #5      asyncGuard.<anonymous closure>
          (package:flutter_tools/src/base/async_guard.dart:109)
          #6      _rootRun (dart:async/zone.dart:1525)
          #7      _CustomZone.run (dart:async/zone.dart:1422)
          #8      _runZoned (dart:async/zone.dart:2033)
          #9      runZonedGuarded (dart:async/zone.dart:2019)
          #10     runZoned (dart:async/zone.dart:1952)
          #11     asyncGuard (package:flutter_tools/src/base/async_guard.dart:106)
          #12     Doctor.startValidatorTasks
          (package:flutter_tools/src/doctor.dart:234)
          #13     Doctor.diagnose (package:flutter_tools/src/doctor.dart:372)
          #14     DoctorCommand.runCommand
          (package:flutter_tools/src/commands/doctor.dart:59)
          #15     FlutterCommand.verifyThenRunCommand
          (package:flutter_tools/src/runner/flutter_command.dart:1897)
          <asynchronous suspension>
          #16     FlutterCommand.run.<anonymous closure>
          (package:flutter_tools/src/runner/flutter_command.dart:1551)
          <asynchronous suspension>
          #17     AppContext.run.<anonymous closure>
          (package:flutter_tools/src/base/context.dart:154)
          <asynchronous suspension>
          #18     CommandRunner.runCommand (package:args/command_runner.dart:212)
          <asynchronous suspension>
          #19     FlutterCommandRunner.runCommand.<anonymous closure>
          (package:flutter_tools/src/runner/flutter_command_runner.dart:501)
          <asynchronous suspension>
          #20     AppContext.run.<anonymous closure>
          (package:flutter_tools/src/base/context.dart:154)
          <asynchronous suspension>
          #21     FlutterCommandRunner.runCommand
          (package:flutter_tools/src/runner/flutter_command_runner.dart:438)
          <asynchronous suspension>
          #22     run.<anonymous closure>.<anonymous closure>
          (package:flutter_tools/runner.dart:98)
          <asynchronous suspension>
          #23     AppContext.run.<anonymous closure>
          (package:flutter_tools/src/base/context.dart:154)
          <asynchronous suspension>
          #24     AppContext.run.<anonymous closure>
          (package:flutter_tools/src/base/context.dart:154)
          <asynchronous suspension>
          #25     run (package:mobile.flutter.cli/flutter_tools.dart:106)
          <asynchronous suspension>
          #26     main (google3:///mobile/flutter/cli/bin/cli_usage_aot.dart:4)
          <asynchronous suspension>
    
    
    [✓] VS Code (version unknown) [0ms]
        • VS Code at /usr/share/code
        • Flutter extension can be installed from:
          🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
        ✗ Unable to determine VS Code version.
    
    [✓] Connected device (2 available) [502ms]
        • Pixel 7a (mobile) • localhost:38655 • android-arm64 • Android 13 (API 33)
        • Linux (desktop)   • linux           • linux-x64     • Debian GNU/Linux
          rodete 6.12.17-1rodete2-amd64
    
    [✓] Google3 (on linux) [11ms]
        • KVM enabled
    
    ! Doctor found issues in 1 category.
    
    
  6. ChristianEdwardPadilla commented on May 8, 2025

    @ChristianEdwardPadilla

    The flutter tools issue is a red herring - unrelated to the crash being reported. letramygoogle is attempting to create a minimal repro now and will report back with more public info 🙏🙏🙏🙏🙏🙏

  7. letramygoogle commented on May 8, 2025

    @letramygoogle
    Author

    Pasting the stack trace here

    error: setState() or markNeedsBuild() called when widget tree was locked.
    This _IconButtonM3 widget cannot be marked as needing to build because the framework is locked.
    The widget on which setState() or markNeedsBuild() was called was:
    _IconButtonM3
    stackTrace: #0 Element.markNeedsBuild.<anonymous closure> (package:flutter/src/widgets/framework.dart:5273:9)
    #1 Element.markNeedsBuild (package:flutter/src/widgets/framework.dart:5283:6)
    #2 State.setState (package:flutter/src/widgets/framework.dart:1219:15)
    #3 _ButtonStyleState.handleStatesControllerChange (package:flutter/src/material/button_style_button.dart:326:5)
    #4 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:435:24)
    #5 WidgetStatesController.update (package:flutter/src/widgets/widget_state.dart:1152:7)
    #6 _InkResponseState.updateHighlight (package:flutter/src/material/ink_well.dart:995:26)
    #7 _InkResponseState.handleTapCancel (package:flutter/src/material/ink_well.dart:1211:5)
    #8 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:345:24)
    #9 TapGestureRecognizer.handleTapCancel (package:flutter/src/gestures/tap.dart:800:11)
    #10 BaseTapGestureRecognizer._checkCancel (package:flutter/src/gestures/tap.dart:388:5)
    #11 BaseTapGestureRecognizer.resolve (package:flutter/src/gestures/tap.dart:336:7)
    #12 OneSequenceGestureRecognizer.dispose (package:flutter/src/gestures/recognizer.dart:470:5)
    #13 PrimaryPointerGestureRecognizer.dispose (package:flutter/src/gestures/recognizer.dart:765:11)
    #14 RawGestureDetectorState.dispose (package:flutter/src/widgets/gesture_detector.dart:1529:18)
    #15 StatefulElement.unmount (package:flutter/src/widgets/framework.dart:5922:11)
    #16 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2075:13)
    #17 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #18 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #19 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #20 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #21 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6994:14)
    #22 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #23 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #24 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #25 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #26 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #27 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #28 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #29 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #30 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6994:14)
    #31 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #32 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #33 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6994:14)
    #34 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #35 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #36 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #37 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #38 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #39 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #40 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #41 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #42 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #43 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #44 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #45 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #46 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #47 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #48 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #49 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #50 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #51 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #52 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #53 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #54 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #55 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #56 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #57 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #58 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #59 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #60 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #61 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #62 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #63 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #64 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #65 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #66 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #67 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #68 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #69 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #70 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #71 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #72 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #73 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #74 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #75 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #76 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #77 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #78 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #79 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #80 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #81 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6994:14)
    #82 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #83 ListIterable.forEach (dart:_internal/iterable.dart:49:13)
    #84 _InactiveElements._unmountAll (package:flutter/src/widgets/framework.dart:2084:25)
    #85 BuildOwner.lockState (package:flutter/src/widgets/framework.dart:2965:15)
    #86 BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:3288:7)
    #87 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1255:19)
    #88 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:495:5)
    #89 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1438:15)
    #90 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1351:9)
    #91 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1204:5)
    #92 _rootRun (dart:async/zone.dart:1525:13)
    #93 _CustomZone.run (dart:async/zone.dart:1422:19)
    #94 _CustomZone.runGuarded (dart:async/zone.dart:1321:7)
    #95 _invoke (dart:ui/hooks.dart:333:10)
    #96 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:444:5)
    #97 _drawFrame (dart:ui/hooks.dart:303:31)
    W 2025-05-05 10:39:36.156156 fitbit.p11.companion.crash: Sending report.
    error: setState() or markNeedsBuild() called when widget tree was locked.
    This _InkResponseStateWidget widget cannot be marked as needing to build because the framework is locked.
    The widget on which setState() or markNeedsBuild() was called was:
    _InkResponseStateWidget
    stackTrace: #0 Element.markNeedsBuild.<anonymous closure> (package:flutter/src/widgets/framework.dart:5273:9)
    #1 Element.markNeedsBuild (package:flutter/src/widgets/framework.dart:5283:6)
    #2 State.setState (package:flutter/src/widgets/framework.dart:1219:15)
    #3 _InkResponseState.handleStatesControllerChange (package:flutter/src/material/ink_well.dart:894:5)
    #4 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:435:24)
    #5 WidgetStatesController.update (package:flutter/src/widgets/widget_state.dart:1152:7)
    #6 _InkResponseState.updateHighlight (package:flutter/src/material/ink_well.dart:995:26)
    #7 _InkResponseState.handleTapCancel (package:flutter/src/material/ink_well.dart:1211:5)
    #8 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:345:24)
    #9 TapGestureRecognizer.handleTapCancel (package:flutter/src/gestures/tap.dart:800:11)
    #10 BaseTapGestureRecognizer._checkCancel (package:flutter/src/gestures/tap.dart:388:5)
    #11 BaseTapGestureRecognizer.resolve (package:flutter/src/gestures/tap.dart:336:7)
    #12 OneSequenceGestureRecognizer.dispose (package:flutter/src/gestures/recognizer.dart:470:5)
    #13 PrimaryPointerGestureRecognizer.dispose (package:flutter/src/gestures/recognizer.dart:765:11)
    #14 RawGestureDetectorState.dispose (package:flutter/src/widgets/gesture_detector.dart:1529:18)
    #15 StatefulElement.unmount (package:flutter/src/widgets/framework.dart:5922:11)
    #16 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2075:13)
    #17 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #18 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #19 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #20 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #21 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6994:14)
    #22 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #23 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #24 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #25 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #26 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #27 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #28 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #29 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #30 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6994:14)
    #31 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #32 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #33 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6994:14)
    #34 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #35 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #36 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #37 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #38 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #39 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #40 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #41 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #42 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #43 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #44 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #45 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #46 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #47 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #48 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #49 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #50 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #51 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #52 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #53 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #54 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #55 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #56 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #57 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #58 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #59 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #60 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #61 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #62 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #63 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #64 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #65 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #66 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #67 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #68 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #69 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #70 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #71 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #72 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #73 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #74 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #75 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #76 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #77 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #78 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5763:14)
    #79 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #80 _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2073:7)
    #81 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6994:14)
    #82 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2071:13)
    #83 ListIterable.forEach (dart:_internal/iterable.dart:49:13)
    #84 _InactiveElements._unmountAll (package:flutter/src/widgets/framework.dart:2084:25)
    #85 BuildOwner.lockState (package:flutter/src/widgets/framework.dart:2965:15)
    #86 BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:3288:7)
    #87 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1255:19)
    #88 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:495:5)
    #89 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1438:15)
    #90 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1351:9)
    #91 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1204:5)
    #92 _rootRun (dart:async/zone.dart:1525:13)
    #93 _CustomZone.run (dart:async/zone.dart:1422:19)
    #94 _CustomZone.runGuarded (dart:async/zone.dart:1321:7)
    #95 _invoke (dart:ui/hooks.dart:333:10)
    #96 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:444:5)
    #97 _drawFrame (dart:ui/hooks.dart:303:31)
    
  8. darshankawar commented on May 8, 2025

    @darshankawar
    Member

    Thanks for the logs, I'll keep the issue open and label for team's tracking based on the error report and log.

  9. added
    c: crashStack traces logged to the console
    toolAffects the "flutter" command-line tool. See also t: labels.
    frameworkflutter/packages/flutter repository. See also f: labels.
    t: flutter doctorProblem related to the "flutter doctor" tool
    on May 8, 2025
  10. 7 remaining items

  11. added
    P2Important issues not at the top of the work list
    on May 13, 2025
  12. victorsanni commented on May 14, 2025

    @victorsanni
    Contributor

    The roll in the description only has 3 PRs... #167614 I think is the most likely culprit, but we can't know without more information to reproduce it.

  13. letramygoogle commented on May 16, 2025

    @letramygoogle
    Author

    Attached the minimum reprod in cl/759384483

  14. victorsanni commented on May 16, 2025

    @victorsanni
    Contributor

    I was able to reproduce it only once. I still don't know how.

    EDIT: Finally able to repro on iOS simulator.

    tooltip.bug.repro.mov
    Sample code
    import 'package:flutter/material.dart';
    
    void main() => runApp(const ReproApp());
    
    class ReproApp extends StatelessWidget {
      const ReproApp({super.key});
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'Flutter Demo',
          theme: ThemeData(
            colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
            useMaterial3: true,
          ),
          home: InitialPage(title: 'Flutter Demo Home Page'),
        );
      }
    }
    
    class InitialPage extends StatelessWidget {
      final String title;
    
      InitialPage({Key? key, required this.title}) : super(key: key);
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            title: Text(title, style: TextStyle(fontFamily: 'ProductSans')),
          ),
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text('Welcome to the Initial Page!'),
                SizedBox(height: 20),
                ElevatedButton(
                  onPressed: () {
                    Navigator.push(
                      context,
                      MaterialPageRoute(builder: (context) => MyHomePage(title: 'Flutter Demo Home Page')),
                    );
                  },
                  child: Text('Go to Counter Page'),
                ),
              ],
            ),
          ),
        );
      }
    }
    
    class MyHomePage extends StatefulWidget {
      MyHomePage({Key? key, required this.title}) : super(key: key);
    
      final String title;
    
      @override
      _MyHomePageState createState() => _MyHomePageState();
    }
    
    class _MyHomePageState extends State<MyHomePage> {
      int _counter = 0;
    
      void _incrementCounter() {
        setState(() {
          _counter++;
        });
      }
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            title: Text(widget.title, style: TextStyle(fontFamily: 'ProductSans')),
          ),
          body: Center(
            child: Column( // Use Column to place multiple widgets vertically
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text(
                  'Button tapped $_counter time${_counter == 1 ? '' : 's'}.',
                  key: Key('CountText'),
                ),
                SizedBox(height: 20), // Add some space
                ElevatedButton(
                  onPressed: () {
                    // Navigate to the new DetailsPage
                    Navigator.push(
                      context,
                      MaterialPageRoute(builder: (context) => DetailsPage()),
                    );
                  },
                  child: Text('Go to Details Page'),
                ),
              ],
            ),
          ),
          floatingActionButton: FloatingActionButton(
            onPressed: _incrementCounter,
            tooltip: 'Increment',
          ),
        );
      }
    }
    
    class DetailsPage extends StatelessWidget {
      const DetailsPage({Key? key}) : super(key: key);
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            title: Text('Details Page', style: TextStyle(fontFamily: 'ProductSans')),
          ),
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text(
                  'This is the details page!',
                  style: Theme.of(context).textTheme.headlineSmall,
                ),
                SizedBox(height: 20),
                ElevatedButton(
                  onPressed: () {
                    Navigator.pop(context);
                  },
                  child: Text('Go Back'),
                ),
              ],
            ),
          ),
        );
      }
    }
  15. victorsanni commented on May 16, 2025

    @victorsanni
    Contributor

    Confirmed, #167614 causes the bug. cc @rkishan516 who was the PR author.

  16. rkishan516 commented on May 17, 2025

    @rkishan516
    Contributor

    Yes @victorsanni, I think #168546 should be able to resolve this issue. Can you please test ?

  17. justinmc commented on May 19, 2025

    @justinmc
    Contributor

    I can reproduce this consistently with this code. Navigate to the details page and then press the back button twice to return to the root page.

    Code
    import 'package:flutter/material.dart';
    
    void main() async {
      runApp(_MyApp());
    }
    
    class _MyApp extends StatelessWidget {
      const _MyApp();
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'Flutter Demo',
          home: InitialPage(title: 'Initial Page'),
        );
      }
    }
    
    class InitialPage extends StatelessWidget {
      final String title;
    
      const InitialPage({super.key, required this.title});
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            title: Text(title, style: TextStyle(fontFamily: 'ProductSans')),
          ),
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text('Welcome to the Initial Page!'),
                SizedBox(height: 20),
                ElevatedButton(
                  onPressed: () {
                    Navigator.push(
                      context,
                      MaterialPageRoute(
                          builder: (context) =>
                              MyHomePage(title: 'Flutter Demo Home Page')),
                    );
                  },
                  child: Text('Go to Counter Page'),
                ),
              ],
            ),
          ),
        );
      }
    }
    
    class MyHomePage extends StatelessWidget {
      const MyHomePage({super.key, required this.title});
    
      final String title;
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            title: Text(title, style: TextStyle(fontFamily: 'ProductSans')),
            leading: BackButton(
              onPressed: () {
                print('justin pressed back on second page.');
                Navigator.maybePop(context);
              },
            ),
          ),
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                ElevatedButton(
                  onPressed: () {
                    // Navigate to the new DetailsPage
                    Navigator.push(
                      context,
                      MaterialPageRoute(builder: (context) => DetailsPage()),
                    );
                  },
                  child: Text('Go to Details Page'),
                ),
              ],
            ),
          ),
        );
      }
    }
    
    class DetailsPage extends StatelessWidget {
      const DetailsPage({super.key});
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            leading: BackButton(
              onPressed: () {
                print('justin pressed back on details.');
                Navigator.maybePop(context);
              },
            ),
            title:
                Text('Details Page', style: TextStyle(fontFamily: 'ProductSans')),
          ),
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text(
                  'This is the details page!',
                  style: Theme.of(context).textTheme.headlineSmall,
                ),
                SizedBox(height: 20),
                ElevatedButton(
                  onPressed: () {
                    Navigator.pop(context);
                  },
                  child: Text('Go Back'),
                ),
              ],
            ),
          ),
        );
      }
    }

    Indeed #168546 seems to fix this issue. I guess the tooltip was interfering with the button somehow. I also tried removing the tooltip from the BackButton on master and that also fixed the issue (though requires multiple taps).

  18. changed the title [-][Google3 Bug]: App crash due to Flutter roll[/-] [+][Google3 Bug]: Back button causes crash[/+] on May 19, 2025
  19. added a commit that references this issue on May 21, 2025
    86f6c72
  20. added
    r: fixedIssue is closed as already fixed in a newer version
    on May 21, 2025
  21. arnoutvandervorst commented on Jun 2, 2025

    @arnoutvandervorst

    When does this land in the 3.33 beta channel?

  22. github-actions commented on Jun 16, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  23. locked as resolved and limited conversation to collaborators on Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consolecustomer: googleVarious Google teamsframeworkflutter/packages/flutter repository. See also f: labels.needs repro infoAutomated crash report whose cause isn't yet knownr: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions