sony / flutter-embedded-linux

Embedded Linux embedding for Flutter
BSD 3-Clause "New" or "Revised" License
1.2k stars 127 forks source link

flutter-client fails to start Dart VM HTTP Service #281

Closed LeoBound closed 1 year ago

LeoBound commented 2 years ago

Hi,

I've built the debug wayland recipes using meta-flutter and can run flutter apps in debug mode. Whenever I start a flutter app (by using flutter-client -b /path/to/bundle) I get the following error

flutter: Could not start Dart VM service HTTP server:
SocketException: Failed to create server socket (OS Error: Cannot assign requested address, errno = 99), address = 127.0.0.1, port = 0
#0      _NativeSocket.bind (dart:io-patch/socket_patch.dart:996:7)
<asynchronous suspension>
#1      Server.startup.startServer (dart:vmservice_io/vmservice_server.dart:424:19)
<asynchronous suspension>
#2      Server.startup (dart:vmservice_io/vmservice_server.dart:443:11)
<asynchronous suspension>

and subsequently I am unable to attach the debugger. This also fails when using flutter custom-devices on a host machine to try and debug (same error).

Why would this be, is there a way to see a more verbose log?

Thanks

HidenoriMatsubayashi commented 2 years ago

Are you using docker? If yes, does this issue help you?

LeoBound commented 2 years ago

Unfortunately not - I'm running it on some embedded hardware where I added meta-flutter to the yocto build process.

HidenoriMatsubayashi commented 2 years ago

Sorry, I can't debug any further as I don't know your environment. Are you using flutter-elinux? How did you create /path/to/bundle?

LeoBound commented 2 years ago

The bundle was created with flutter build bundle with the standard flutter tool. After these errors the application does run as expected - there is just no way to debug it. Could you let me know what details you need to know about the environment? It's a custom board with an iMX6.

Thanks

HidenoriMatsubayashi commented 2 years ago

Are you trying to attach your flutter app from your host PC or just launching it on arm64 devices?

HidenoriMatsubayashi commented 2 years ago

After these errors the application does run as expected - there is just no way to debug it.

I think that the settings related to the network/port of the device you are using are affecting the error. But no one can advise without repro steps, commands, and whole logs.

LeoBound commented 2 years ago

Do you know where could I find more verbose logs?

The logs in my first post are the output of flutter-client -f -b /path/to/bundle. Does flutter-client or the flutter engine output any other logs, I couldn't find any in /var/logs.

My steps were:

I'm using dropbear for SSH access instead of OpenSSH, could this be why?

HidenoriMatsubayashi commented 2 years ago

Add the device with flutter custom-devices with the flutter SDK (3.0.5)

Why are you using the official flutter SDK? Could you try using flutter-elinux once?

HidenoriMatsubayashi commented 1 year ago

Closing as no update for a while.