Skip to content

Conversation

@Lancelotmay
Copy link

Issue:

In the original packaging script, libraries (.so) and runtime files into /usr/bin instead of a dedicated library folder. This caused installed executables to fail at runtime (System.DllNotFoundException) because the dynamic linker could not find libSkiaSharp and other dependencies.

Correction:

All runtime libraries (.dll, .so, .json, .pdb) and Assets are now copied to /usr/lib/aictionary.
/usr/bin/Aictionary is a small wrapper that sets LD_LIBRARY_PATH to point to /usr/lib/aictionary before launching the main executable.
This ensures both self-contained and framework-dependent packages can run correctly after installation.

Test done:

basic test on ubuntu24.04, self-contained mode

Orignal error

# Aictionary
Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: 
/usr/bin/libSkiaSharp.so: cannot open shared object file: No such file or directory
/usr/bin/liblibSkiaSharp.so: cannot open shared object file: No such file or directory
/usr/bin/libSkiaSharp: cannot open shared object file: No such file or directory
/usr/bin/liblibSkiaSharp: cannot open shared object file: No such file or directory

   at SkiaSharp.SKImageInfo..cctor()
   --- End of inner exception stack trace ---
   at Avalonia.Skia.SkiaPlatform.Initialize(SkiaOptions options)
   at Avalonia.AppBuilder.SetupUnsafe()
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action`1 lifetimeBuilder)
   at Aictionary.Program.Main(String[] args)
Aborted (core dumped)

@ahpxex
Copy link
Owner

ahpxex commented Oct 29, 2025

非常感谢

@ahpxex ahpxex merged commit 9279298 into ahpxex:master Oct 29, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants