GLIBC_2.33 not found - while building Flutter for Linux
Asked Answered
D

6

13

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.

Desouza answered 21/10, 2022 at 15:43 Comment(0)
O
15

It's a snap problem with vscode. First remove vscode :

sudo snap remove code

Then download the .deb of vscode here : https://code.visualstudio.com/docs/setup/linux

And install it with :

sudo apt install ./<file>.deb
Onofredo answered 2/11, 2022 at 14:7 Comment(3)
I think you're right. I had another vscode issue opened in GitHub and the contributor recommended me to download .deb and it solved.Desouza
Same for me! This was the only solution. ThanksGuajardo
Fixed it for me - and also fixed launching the app in Android emulator. Oh, Snap. Isolation is great, except for when it breaks everything.Dailey
B
8

I had this problem. I just uninstalled and reinstalled flutter. It worked nice.

snap remove flutter

snap install flutter

flutter doctor
Blandish answered 23/11, 2022 at 8:15 Comment(2)
Uninstalling and reinstalling worked for me. I made sure to follow the install directions: sudo snap install flutter --classicHanes
This does not work for me. My case is that linux build worked until adding dependency to audioplayer... on Ubuntu 23.04.Ascent
A
5

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.

Abdication answered 22/10, 2022 at 0:50 Comment(2)
When I run ldd --version it shows, ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35. Which means GLIBC 2.35 is installed.Desouza
@AshrafulAlamShakil Yes, your system has GLIBC-2.35 installed, but no your application is not using it (and is using a different version from /snap/flutter/130/lib/x86_64-linux-gnu/) which is exactly the problem.Abdication
C
5

All the previous answers of reinstalling and changing environment variables didn't work for me. glibc 2.35 was installed on my Fedora 36 and the build kept spitting out linker errors saying GLIBC_2.33 not found. After some searching, I found that the reason is that the glibc used to compile is an old one installed by snap. If you look closely at the linker error, you'll see that lib.so.6 file is in a snap directory. If you go to the directory specified, you'll find that the glibc installed there is indeed version 2.31 (or some other older version). I solved the problem by deleting the snap version and following the manual install instructions on the Flutter download page.

Cozmo answered 12/6, 2023 at 9:7 Comment(1)
Works for me on Ubuntu 23.04 after trying to add a dependency to audioplayer and installed a bunch of apt packages needed by audioplayer...Ascent
I
4

Try to check also your Environment Variable LD_LIBRARY_PATH. I had modified it (in .bashrc file in home directory) for other tasks and it causes to me the same issue

Illusion answered 26/4, 2023 at 19:24 Comment(0)
G
3
  • 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

Goeger answered 22/10, 2022 at 9:56 Comment(2)
Thanks a lot. The error is not gone yet, but it builds the application. Previously, it failed to build with the error. Now, it builds and run the app without any problem even though the error is still showing. I used the second line to upgrade.Desouza
Doesn't change things for me.Deemster

© 2022 - 2024 — McMap. All rights reserved.