question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linux : System.DllNotFoundException: Unable to load DLL 'libSkiaSharp'

See original GitHub issue

Description

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:closed
  • Created 5 years ago
  • Comments:35 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
mattleibowcommented, Dec 9, 2018

@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

0reactions
mattleibowcommented, Dec 14, 2018

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.

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found