16

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.

6 Answers 6

16

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
Sign up to request clarification or add additional context in comments.

2 Comments

I think you're right. I had another vscode issue opened in GitHub and the contributor recommended me to download .deb and it solved.
Fixed it for me - and also fixed launching the app in Android emulator. Oh, Snap. Isolation is great, except for when it breaks everything.
9

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

snap remove flutter

snap install flutter

flutter doctor

2 Comments

Uninstalling and reinstalling worked for me. I made sure to follow the install directions: sudo snap install flutter --classic
This does not work for me. My case is that linux build worked until adding dependency to audioplayer... on Ubuntu 23.04.
6

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.

2 Comments

When I run ldd --version it shows, ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35. Which means GLIBC 2.35 is installed.
@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.
5

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

Comments

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.

1 Comment

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...
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

2 Comments

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.
Doesn't change things for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.