Home > Net >  GLIBC_2.33 not found - while building Flutter for Linux
GLIBC_2.33 not found - while building Flutter for Linux

Time:10-22

I was trying to run a flutter app on Ubuntu 22.04 LTS. Everything was working fine. But, today this problem came up while running the app. The Flutter SDK fails to build the app throwing the below error.

/snap/flutter/130/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/../../../../lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so)
Failed to load module: /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so

After searching on the internet I realized I need a backward version of libc. If I do file /snap/flutter/130/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/../../../../lib/x86_64-linux-gnu/libc.so.6.
I get the result /snap/flutter/130/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/../../../../lib/x86_64-linux-gnu/libc.so.6: symbolic link to libc-2.31.so.

Probably I need to install libc-2.31. But, how? I did not find any solution. Both Flutter and Ubuntu are upgraded to the latest versions.

CodePudding user response:

After searching on the internet I realized I need a backward version of libc.

No, you don't.

The error means: the version of GLIBC you are using is too old and does not satisfy requirements of the system libgvfsdbus.so which you are trying to load.

Your application appears to be using a custom version of GLIBC, located in /snap/flutter/130/lib/x86_64-linux-gnu/libc.so.6, which is older than the system-installed GLIBC (which is likely 2.33 or newer).

I don't know whether Flutter makes you use a custom GLIBC, or whether you chose to do so on your own. Either way, this seems like a terrible idea.

If you must use custom GLIBC for this app, then you should not use any system libraries (such as /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so) in it.

CodePudding user response:

  • moving to edge channel, snap refresh flutter --edge
  • running flutter upgrade
  • deleting build directory rm -r build/
  • running the application again flutter run -d linux

reference this

  • Related