Skip to content

[Android] Hang on Splash Screen following process restoration when run with --start-paused #142149

Open

Description

@btrautmann

Some Context

This was originally opened with the Dart-Code team here as I noticed the behavior only when running from VSCode. @DanTup was kind enough to look into it and prove that this is actually reproducible outside of VSCode using --start-paused. See @DanTup's comments on the linked ticket for more.

Steps to reproduce

⚠️ NOTE: I created this repo for reproducing (basically a simple flutter create -e, but allows all commands below to succeed automatically).

Steps to reproduce the behavior (WITH VSCode):

  1. flutter create -e restoration_bug
  2. cd restoration_bug
  3. Open main.dart and make sure an Android device is selected. We've found this reproduces 100% on Android 14 devices, but have not tested much outside that. Will test a variety of OS versions and report back via comments.
  4. On your device, enable developer options and set the Background process limit to No background processes (this will just help to have the system kill the process sooner than it normally would)
  5. Run the app via the Run button on the main function
  6. Background the app and run other apps until Android kills the Flutter process. You can be sure it is killed by running adb shell pidof com.example.restoration_bug and verifying there is NO output. If output exists, the app is still running under that process ID.
  7. Once output of above command is clear, open the app back up via Recents or from Home Screen Launcher.
  8. Note that the app never progresses beyond the Splash Screen which shows the Flutter logo.

See @DanTup 's comment for steps to reproduce WITHOUT VSCode

Expected results

The app should land on the initial route which shows a Hello world message.

Actual results

The app hangs on the splash screen. See video in section below.

Code sample

See the repository linked in the Steps to reproduce section.

Screenshots or Video

This video shows how restoration behaves when run from VSCode and then when run after quitting the app:

Screen.Recording.2024-01-23.at.13.01.32.mov

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.16.4, on macOS 14.3 23D56 darwin-arm64, locale en-US)
    • Flutter version 3.16.4 on channel stable at /Users/brandontrautmann/fvm/versions/3.16.4
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2e9cb0aa71 (6 weeks ago), 2023-12-11 14:35:13 -0700
    • Engine revision 54a7145303
    • Dart version 3.2.3
    • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/brandontrautmann/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_SDK_ROOT = /Users/brandontrautmann/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] IntelliJ IDEA Community Edition (version 2023.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.85.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.80.0

[✓] Connected device (4 available)
    • moto x4 (mobile)          • ZY224LJPKC                • android-arm64  • Android 9 (API 28)
    • Brandon’s iPhone (mobile) • 00008110-000674483E20201E • ios            • iOS 17.3 21D50
    • macOS (desktop)           • macos                     • darwin-arm64   • macOS 14.3 23D56 darwin-arm64
    • Chrome (web)              • chrome                    • web-javascript • Google Chrome 120.0.6099.234

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Activity

  1. btrautmann commented on Jan 24, 2024

    @btrautmann
    Author

    CC @DanTup in the event you don't get pinged for the mention in the Issue Description.

  2. danagbemava-nc commented on Jan 25, 2024

    @danagbemava-nc
    Member

    Reproducible using the steps provided above.

    I tested on a Pixel 7 (running android 14) and a Pixel 7 emulator running android 12. It reproduced in both cases.

    flutter doctor -v
    [✓] Flutter (Channel master, 3.19.0-9.0.pre.144, on Microsoft Windows [Version 10.0.22631.3007], locale en-GH)
        • Flutter version 3.19.0-9.0.pre.144 on channel master at C:\Users\Deana\fvm\versions\master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 295a9a2031 (2 hours ago), 2024-01-24 23:51:25 -0800
        • Engine revision 5fa2e29202
        • Dart version 3.4.0 (build 3.4.0-70.0.dev)
        • DevTools version 2.31.0
    
    [✓] Windows Version (Installed version of Windows is version 10 or higher)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at C:\Users\Deana\AppData\Local\Android\sdk
        • Platform android-34, build-tools 34.0.0
        • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
        • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
        • All Android licenses accepted.
    
    [✓] Chrome - develop for the web
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.2)
        • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
        • Visual Studio Community 2022 version 17.8.34322.80
        • Windows 10 SDK version 10.0.22621.0
    
    [✓] Android Studio (version 2023.1)
        • Android Studio at C:\Program Files\Android\Android Studio
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    
    [✓] VS Code (version 1.85.2)
        • VS Code at C:\Users\Deana\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.80.0
    
    [✓] Connected device (4 available)
        • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 12 (API 31) (emulator)
        • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22631.3007]
        • Chrome (web)                 • chrome        • web-javascript • Google Chrome 120.0.6099.227
        • Edge (web)                   • edge          • web-javascript • Microsoft Edge 120.0.2210.144
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    
    [!] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Version 10.0.22631.3007], locale en-GH)
        • Flutter version 3.16.5 on channel stable at C:\Users\Deana\fvm\versions\stable
        ! Warning: `flutter` on your path resolves to C:\Users\Deana\fvm\versions\master\bin\flutter, which is not inside your current Flutter SDK checkout at C:\Users\Deana\fvm\versions\stable. Consider adding C:\Users\Deana\fvm\versions\stable\bin to the front of your path.
        ! Warning: `dart` on your path resolves to C:\Users\Deana\fvm\versions\master\bin\dart, which is not inside your current Flutter SDK checkout at C:\Users\Deana\fvm\versions\stable. Consider adding C:\Users\Deana\fvm\versions\stable\bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 78666c8dc5 (5 weeks ago), 2023-12-19 16:14:14 -0800
        • Engine revision 3f3e560236
        • Dart version 3.2.3
        • DevTools version 2.28.4
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Windows Version (Installed version of Windows is version 10 or higher)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at C:\Users\Deana\AppData\Local\Android\sdk
        • Platform android-34, build-tools 34.0.0
        • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
        • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
        • All Android licenses accepted.
    
    [✓] Chrome - develop for the web
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.2)
        • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
        • Visual Studio Community 2022 version 17.8.34322.80
        • Windows 10 SDK version 10.0.22621.0
    
    [✓] Android Studio (version 2023.1)
        • Android Studio at C:\Program Files\Android\Android Studio
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    
    [✓] VS Code (version 1.85.2)
        • VS Code at C:\Users\Deana\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.80.0
    
    [✓] Connected device (4 available)
        • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 12 (API 31) (emulator)
        • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22631.3007]
        • Chrome (web)                 • chrome        • web-javascript • Google Chrome 120.0.6099.227
        • Edge (web)                   • edge          • web-javascript • Microsoft Edge 120.0.2210.144
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
    
  3. added
    platform-androidAndroid applications specifically
    toolAffects the "flutter" command-line tool. See also t: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-androidOwned by Android platform team
    and removed
    in triagePresently being triaged by the triage team
    on Jan 25, 2024
  4. added
    P2Important issues not at the top of the work list
    triaged-androidTriaged by Android platform team
    on Jan 25, 2024
  5. added a commit that references this issue on May 14, 2026
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 lista: state restorationRestorationManager and related APIsfound in release: 3.16Found to occur in 3.16found in release: 3.19Found to occur in 3.19has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions