flutter_avif icon indicating copy to clipboard operation
flutter_avif copied to clipboard

Not working on linux

Open MegatronKing opened this issue 3 months ago • 2 comments

I got this log on my ubuntu 20.04.5 LTS

flutter: `flutter_avif_linux` threw an error: Invalid argument(s): Failed to load dynamic library 'libflutter_avif.so': /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/king1234/workspace/reqable/reqable-desktop/build/linux/x64/release/bundle/lib/libflutter_avif.so). The app may not function as expected until you remove this plugin from pubspec.yaml
09-29 03:12:53.0528 [E][Dart]: Exception: LateInitializationError: Field 'api' has not been initialized.
#0      SingleFrameAvifCodec.getNextFrame (package:flutter_avif/src/avif_image.dart:1071)
#1      AvifImageStreamCompleter._decodeNextFrameAndSchedule (package:flutter_avif/src/avif_image.dart:1206)
#2      AvifImageStreamCompleter._handleCodecReady (package:flutter_avif/src/avif_image.dart:1165)
#3      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:838)
#4      Future._propagateToListeners (dart:async/future_impl.dart:867)
#5      Future._completeWithValue (dart:async/future_impl.dart:643)

MegatronKing avatar Sep 29 '25 10:09 MegatronKing

I built the Linux binaries on Ubuntu 22.04, which I believe uses a newer version of glibc than 20.04. I’m not a Linux expert, but I’m guessing that’s why you’re seeing this error. I’ll try installing 20.04 on a VM to see if I can replicate the issue.

yekeskin avatar Oct 01 '25 22:10 yekeskin

It's recommended to build linux libs using Docker otherwise it might link with a new version of glibc.

22.04 works for me, but you could build with a 20.04.5 docker image to work for this guy.

sgehrman avatar Nov 13 '25 01:11 sgehrman