Flutter运行意外退出问题求助(Parrot Linux环境)
Issue Details
I encountered a problem where my Flutter application abruptly stops running on Parrot Linux, throwing the error flutter exits unexpectedly. Below is the output from running flutter doctor:
─[✗]─[dracula@parrot]─[~] └──╼ $flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel beta, v0.2.3, on Linux, locale C.UTF-8) [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3) [✓] Android Studio (version ...)
Troubleshooting Steps
After digging into similar issues, here are the most effective fixes to try:
Switch to the Stable Flutter Channel
Beta channels often carry untested bugs. Switch to stable and upgrade your installation:flutter channel stable flutter upgradeClear Project Cache
Corrupted build cache is a common culprit. Run this in your project directory:flutter cleanThen rebuild with
flutter run.Install Missing System Libraries
Parrot Linux (based on Debian) may lack dependencies required for Flutter to run properly. Install these core libraries:sudo apt update && sudo apt install libgtk-3-0 libx11-dev libxcb-xinerama0-dev libgl1-mesa-glxFix Locale Settings
TheC.UTF-8locale can cause compatibility issues. Set a standard UTF-8 locale temporarily:export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8To make this permanent, add those lines to your
~/.bashrcor~/.zshrcfile and restart your terminal.Update Android Studio Plugins
Outdated Flutter/Dart plugins in Android Studio can lead to unexpected crashes. Navigate toFile > Settings > Plugins(Linux path:Android Studio > Settings > Plugins) to check for and install updates.
If All Else Fails
Try completely reinstalling Flutter by deleting the .flutter directory in your home folder, then downloading the latest stable release and setting up your environment again.
内容的提问来源于stack exchange,提问作者Susil Kumar

