Flutter VM service issue WSL2

119 views Asked by At

I installed Android-SDK on Windows and set up Android emulator with commandline. Then I installed flutter sdk and android sdk on wsl. I started nodaemon adb server for all interfaces with executing adb -a -P 6565 server nodaemon command on Windows cmd and exported $ANDROID_ADB_SERVER_ADDRESS and $ANDROID_ADB_SERVER_PORT environment variables. When I execute adb devices on wsl terminal I see my emulator. I can run flutter project on the emulator. But when I run flutter run -d emulator-5554 I get the below log:

Using hardware rendering with device Android SDK built for x86 64. If you notice graphics artifacts, consider enabling
software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 64 in debug mode...
Running Gradle task 'assembleDebug'...                             10.2s
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Connecting to the VM Service is taking longer than expected...
Still attempting to connect to the VM Service...
If you do NOT see the Flutter application running, it might have crashed. The device logs (e.g. from adb or XCode) might
have more details.
If you do see the Flutter application running on the device, try re-running with --host-vmservice-port to use a specific
port known to be available.
Exception attempting to connect to the VM Service: SocketException: Connection refused (OS Error: Connection refused,
errno = 111), address = 127.0.0.1, port = 40774
This was attempt #50. Will retry in 0:00:01.600000.

How can I fix it?

0

There are 0 answers