Reputation: 532
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.
Upvotes: 13
Views: 60080
Reputation: 51
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.
Upvotes: 5
Reputation: 93
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
Upvotes: 4
Reputation: 7682
I had this problem. I just uninstalled and reinstalled flutter. It worked nice.
snap remove flutter
snap install flutter
flutter doctor
Upvotes: 8
Reputation: 336
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
Upvotes: 15
Reputation: 31
snap refresh flutter --edge
flutter upgrade
rm -r build/
flutter run -d linux
reference this
Upvotes: 3
Reputation: 213456
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.
Upvotes: 5