flutter-webrtc: Linux fatal error when building

Describe the bug

When building on Linux I get this error:

[  +96 ms] Building Linux application... (completed in 6.1s)
[  +26 ms] (fluffychat:230187): Gtk-WARNING **: 20:33:18.576: Locale not supported by C library.
[        ]      Using the fallback 'C' locale.
[ +131 ms] #
[        ] # Fatal error in: ../../media/engine/adm_helpers.cc, line 39
[        ] # last system error: 0
[        ] # Check failed: 0 == adm->Init() (0 vs. -1)
[  +84 ms] # Failed to initialize the ADM.
[   +2 ms] Error waiting for a debug connection: The log reader stopped unexpectedly, or never started.
[   +1 ms] Error launching application on Linux.

To Reproduce

Build on Ubuntu 22.10 with Flutter 3.3.9

Expected behavior

Just builds

Platform information

  • Flutter version: 3.3.9
  • Plugin version: 0.9.18
  • OS: Ubuntu
  • OS version: 22.10

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (16 by maintainers)

Most upvoted comments

From the log, it seems that the runtime failed, which is related to the failure to initialize the audio device module.

[        ] # Fatal error in: ../../media/engine/adm_helpers.cc, line 39
[        ] # last system error: 0
[        ] # Check failed: 0 == adm->Init() (0 vs. -1)
[  +84 ms] # Failed to initialize the ADM.

Have the same error only when start app from console via xinit:

sudo xinit /home/pi/webrtc/build/linux/.../webrtc

When start on desktop all works as well: telegram-cloud-photo-size-2-5357137396229064480-y

Now it builds but it does not start. When trying to start the snap version I have this error:

/snap/fluffychat/556/bin/fluffychat: error while loading shared libraries: libwebrtc.so: cannot open shared object file: No such file or directory

Hi, in my case I could fix the error by adding the directory of the libwebrtc.so file to LD_LIBRARY_PATH environment variable

in my snapcraft.yaml it looks like this:

apps:
  <app name>:
    ...
    environment:
      XDG_DATA_HOME: $SNAP_USER_DATA
      XDG_DATA_DIRS: $SNAP/usr/share
      GDK_GL: gles
      LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP/bin/lib:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET"

This looks like rpath linking issue for libwebrtc.so, let me see how to fix

It looks like the problem happens with snapcraft compiled app? Using flutter run should work correctly (flutter sdk install form snap),

It looks like you are running on a raspberry pi, cool 😉