Repository navigation
[Android] Hang on Splash Screen following process restoration when run with --start-paused #142149
Description
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
flutter create -e, but allows all commands below to succeed automatically).
Steps to reproduce the behavior (WITH VSCode):
flutter create -e restoration_bugcd restoration_bug- Open
main.dartand 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. - 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)
- Run the app via the
Runbutton on themainfunction - 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_bugand verifying there is NO output. If output exists, the app is still running under that process ID. - Once output of above command is clear, open the app back up via Recents or from Home Screen Launcher.
- 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
btrautmann commentedon Jan 24, 2024
CC @DanTup in the event you don't get pinged for the mention in the Issue Description.
danagbemava-nc commentedon Jan 25, 2024
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
Resolve issue flutter#142149: Strip --start-paused flag during Androi…