简体   繁体   English

未找到 GLIBC_2.33 - 在为 Linux 构建 Flutter 时

[英]GLIBC_2.33 not found - while building Flutter for Linux

I was trying to run a flutter app on Ubuntu 22.04 LTS.我试图在 Ubuntu 22.04 LTS 上运行 flutter 应用程序。 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. Flutter SDK 无法构建应用程序并抛出以下错误。

/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 inte.net I realized I need a backward version of libc.在 inte.net 上搜索后,我意识到我需要一个向后版本的 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 .如果我执行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 .我得到结果/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 .可能我需要安装libc-2.31 But, how?但是,怎么办? I did not find any solution.我没有找到任何解决方案。 Both Flutter and Ubuntu are upgraded to the latest versions. Flutter和Ubuntu都升级到最新版本。

It's a snap problem with vscode.这是 vscode 的一个 snap 问题。 First remove vscode:首先删除vscode:

sudo snap remove code

Then download the.deb of vscode here: https://code.visualstudio.com/docs/setup/linux然后在这里下载vscode的.deb: https://code.visualstudio.com/docs/setup/linux

And install it with:并安装它:

sudo apt install ./<file>.deb
  • moving to edge channel, snap refresh flutter --edge移动到边缘通道, snap refresh flutter --edge
  • running flutter upgrade运行flutter upgrade
  • deleting build directory rm -r build/删除构建目录rm -r build/
  • running the application again flutter run -d linux再次运行应用程序flutter run -d linux

reference this参考这个

After searching on the inte.net I realized I need a backward version of libc.在 inte.net 上搜索后,我意识到我需要一个向后版本的 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.错误的意思是:您使用的 GLIBC 版本太旧,不满足您尝试加载的系统libgvfsdbus.so的要求。

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).您的应用程序似乎正在使用自定义版本的 GLIBC,位于/snap/flutter/130/lib/x86_64-linux-gnu/libc.so.6中,它比系统安装的 GLIBC(可能是 2.33 或较新)。

I don't know whether Flutter makes you use a custom GLIBC, or whether you chose to do so on your own.我不知道 Flutter 是让您使用自定义 GLIBC,还是您自己选择这样做。 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.如果您必须为此应用程序使用自定义 GLIBC,则不应在其中使用任何系统库(例如/usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so )。

I had this problem.我有这个问题。 I just uninstalled and reinstalled flutter. It worked nice.我刚刚卸载并重新安装了 flutter。它运行良好。

snap remove flutter

snap install flutter

flutter doctor

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM