Closed tenon-du closed 1 year ago
Hi @DuJerry I noticed Proxy Configuration contains warnings. Could you try solving it and retry running the app?
Also, does the issue occur on a newly created Flutter project? (without using 3rd packages/plugins)
export NO_PROXY="localhost,127.0.0.1,::1"
The subsystem I am currently using is Debian.
Thanks for your update. I'm not quite familiar with WSL/WSL2, could you share the detailed steps to reproduce this issue?
I tried reproducing the issue but can't see it. The app can run normally.
I had WSL2 (Ubuntu-22.04 distro) on my host machine with Microsoft Windows [Version 10.0.19045.3570]
:
C:\WINDOWS\system32>wsl -l -v
NAME STATE VERSION
* Ubuntu Stopped 1
Ubuntu-22.04 Running 2
Could you try checking this on flutter installed from snap?
Did you install flutter with snap?
I installed with snap can compile and start clean applications normally, but I am faced with some packages that cannot be compiled using snap installation, such as media_kit, and they also recommend manual installation.
So under WSL2, if I use snap to install some packages I won't be able to use, and my app won't be able to debug or start using manual installation, even for clean projects.
Is the official recommended manual installation method not applicable to WSL?
Did you install flutter with snap?
No, I installed Flutter manually.
Is the official recommended manual installation method not applicable to WSL?
I don't think there is such an announcement/documentation about this.
I'm more inclined that the issue can come from system configuration. You can try to check the dart process in the system when running app, firewall settings, or proxy. On my side, all configurations are as default, I have not configured anything (the application can run normally).
PC
版本 Windows 11 家庭中文版
版本 22H2
安装日期 2023/10/13
操作系统版本 22621.2428
体验 Windows Feature Experience Pack 1000.22674.1000.0
WSL
PS C:\Users\dugang> wsl -l -v
NAME STATE VERSION
* Debian Running 2
install step
wsl --install Debian
# sys date
sudo hwclock -s
# clash for window proxy
export http_proxy=http://192.168.0.138:7890
export https_proxy=http://192.168.0.138:7890
sudo apt-get update
sudo apt-get upgrade -y
# remove windows path
echo -e "[boot]\nsystemd=true\n[interop]\nappendWindowsPath=false" | sudo tee /etc/wsl.conf
# install zh fonts
sudo apt-get install fonts-noto-cjk -y
sudo fc-cache
sudo dpkg-reconfigure locales
# install flutter sdk
sudo apt-get install git unzip curl -y
git clone https://github.com/flutter/flutter.git
git checkout stable
# config .bashrc
export FLUTTER_HOME="$HOME/flutter"
export PATH="$PATH:$FLUTTER_HOME/bin"
export DART_HOME="$FLUTTER_HOME/bin/cache/dart-sdk"
export PATH="$PATH:$DART_HOME/bin"
export PUB_CACHE="$HOME/.pub-cache"
export PATH="$PATH:$PUB_CACHE/bin"
export NO_PROXY="localhost,127.0.0.1,::1"
# linux desktop compile chain
sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev -y
# 执行doctor
flutter doctor
flutter precache --linux
The above is the step for me to manually configure flutter. I don't know which step is the problem.
Is your installation different from mine, Is your installation different from mine?
Except for proxy settings, I don't see any difference. Since I finished installing the OS, I only added the export PATH to the flutter SDK in the .bashrc
file, along with installing the necessary libraries for building the app as instructed in the documentation.
I have just installed Debian same to you, but it's also working as desired.
Just curious, how did you start WSL? Is it from VS Code? Please try following my guideline from this gist to see if the issue still persists or not.
I'll try again according to your process later, now I need to deal with the problem on Android, thanks for your help.
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.
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.
I am currently using Flutter to develop a Linux desktop application under WSL2. If I use the official recommended automatic installation method, some packages used by my application will not be able to complete the compilation, for example media_kit, the author recommends using the manual installation method. So I tried the manual installation in the official tutorial, and now the application can complete the compilation normally, but it cannot be started.
Steps to reproduce
git clone https://github.com/flutter/flutter.git
git checkout stable
config .bashrc
sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev -y
flutter doctor
flutter precache --linux
flutter create ad_client
flutter run -v
Actual results The error will only appear once after restarting WLS.
Then it becomes
The log reader stopped unexpectedly, or never started
flutter doctor -v
I also tried the Debian subsystem and the problem persists.
I guess the flutter installed by snap works normally because it completes the forwarding of the port, while the manual installation does not. I retrieved issues and stack overflow, but there is no answer to tell how to configure it.