Linux : System.DllNotFoundException: Unable to load DLL 'libSkiaSharp'
See original GitHub issueDescription
I have a .Net Core 2.0 web api running in a linux docker container locally. Ive copied libSkiaSharp to the /app and /app/bin/…/Debug and Release folders just to be sure. My dockerfile installs libfontconfig1. Running ldd libSkiaSharp.so I see:
root@65c88e99a65f:/app# ldd libSkiaSharp.so
linux-vdso.so.1 (0x00007ffcd954a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f92d82fc000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f92d80f8000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f92d7eba000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f92d7bb6000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f92d799f000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f92d7600000)
/lib64/ld-linux-x86-64.so.2 (0x00007f92d8d90000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f92d7351000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f92d7127000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f92d6f0d000)
libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f92d6cda000)
When I call the first action that uses SkiaSharp, I get the dreaded error:
{System.TypeInitializationException: The type initializer for 'SkiaSharp.SKAbstractManagedWStream' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'libSkiaSharp': The specified module or one of its dependencies could not be found.
(Exception from HRESULT: 0x8007007E)
at SkiaSharp.SkiaApi.sk_managedwstream_set_delegates(IntPtr pWrite, IntPtr pFlush, IntPtr pBytesWritten, IntPtr pDestroy)
at SkiaSharp.SKAbstractManagedWStream..cctor()
--- End of inner exception stack trace ---
at SkiaSharp.SKAbstractManagedWStream..ctor(Boolean owns)
at SkiaSharp.SKManagedWStream..ctor(Stream managedStream)
...
Code
n/a
Expected Behavior
It should load the so file.
Actual Behavior
It either cant find the so file or it cant find one of it’s dependencies.
Basic Information
- Version with issue: 1.60.0
- Last known good version: ?
- IDE: Visual Studio
- Platform Target Frameworks:
- Linux: asp.netcore 2.08 docker image which I Debian Jessie - so it that like 16.10?
- Target Devices:
- Web app
Issue Analytics
- State:
- Created 5 years ago
- Comments:35 (11 by maintainers)
Top Results From Across the Web
c# - Docker image - SkiaSharp : Unable to load DLL ...
I'm stucked since I meet the famous "Unable to load DLL 'libSkiaSharp' or one of its dependencies: The specified module could not be...
Read more >Unable to load DLL 'libSkiaSharp'
System.DllNotFoundException: Unable to load DLL 'libSkiaSharp': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at SkiaSharp.
Read more >System.DllNotFoundException - Microsoft Q&A
Unable to load shared library 'libSkiaSharp' or one of its dependencies. ... Linux.NoDependencies are not supported with MAUI.
Read more >Unable to load DLL 'libSkiaSharp' or one of its dependencies
Go to your local nuget cache, by default %userprofile%\. · Search for the SkiaSharp folder · Right click on the folder and choose...
Read more >Unable to load DLL 'libSkiaSharp' or one of its dependencies
I'm afraid this is caused by Azure Function application itself, which has nothing to do with our products. If there is the error...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jackyloo, since the v1.68 release, you no longer need to do all this work. Just install the SkiaSharp.NativeAssets.Linux package - https://github.com/mono/SkiaSharp/issues/312
OK, 😦 I think it might be better to open a new issue with details specific to your case. This way we can track the issue and prioritize.