-
Notifications
You must be signed in to change notification settings - Fork 571
[BUG] Unable to load shared library 'libSkiaSharp' or one of its dependencies in AWS Linux #964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have a similar issue with a .NET Core 3.0 deployment, it was working fine during preview releases of .NET Core 3 up-to preview 9, then seemingly when .NET Core 3.0 final was released it then failed with the same error as you. Adding the following to my Dockerfile fixed the issue;
I guess the underlying image and its dependencies must have changed (regardless of having SkiaSharp.NativeAssets.Linux installed), so maybe this tweak will help... |
If you aren't doing things with text, or if you are brining your own fonts, you could try This NuGet is the same as SkiaSharp.NativeAssets.Linux, but does not have the fontconfig dependency. The downside is that it doesn't have the same support of features - mostly font finding. But it can still draw text. |
I built a lambda layer based on the instructions from this page, using my lambda project instead of the one in the post: https://www.leadtools.com/help/sdk/v20/tutorials/documents/cross-platform/dotnet-core/convert-documents-using-aws-lambda.html For reference, the libraries the script adds for the layer are: |
@f2calv your solution worked for me! Thank you for posting this! I am running .net core 3.1 and was running into the OP above listed error during my cloud deployments to google app engine. During local development on my mac, I had zero issues so you can imagine I was quite perplexed by google app engine giving me grief over this. I tried every variation of the SkiaSharp, SkiaSharp.NativeAssets.Linux, SkaiSharp.NativeAssets.Linux.NoDependencies and every single one failed when deployed to the cloud (all worked while developing on my local machine). Once I flipped over to using a custom docker file and added the Here's how I solved this For those who come after me, here is a snippet of nuget packages in my .csproj: <PackageReference Include="SkiaSharp" Version="2.80.1" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.80.1" /> and a snippet of my Dockerfile:
|
@matt-moody apologies for the grief. I noticed there was a bug in the 2.80.1 package where the NoDependencies binaries still required fontconfig. This was fixed in 2.80.2 and release last week. However, your solution to install |
@mattleibow - Just an FYI version |
What isn't usable in the library with SkiaSharp.NativeAssets.Linux.NoDependencies used and fontconfig not available? Can you still draw text? Are there any fonts or a default font still guaranteed to be available across platforms? |
The NoDependencies version can't search for fonts based on characters or other fonts. Basically, you have to manually load fonts - either by family name or file. |
Been struggling for 2 days with this because I need fonts in a AWS Lambda, so I can't use AWS recently launched Lambda with docker and so we now have how to install the dependencies we need. What you need in
Create a dockerfile (and adapt for the fw version you use):
If you are using a serverless.template update to something like in the image below:
|
Description
I built out a .NET Core 2.1 API that uses SkiaSharp. Works great on Windows & Mac. Deployed to AWS Amazon Linux 2 (Amazon's custom version of CentOS). When I hit the endpoint, I get:
I've already added SkiaSharp.NativeAssets.Linux to my project. I tried putting
libSkiaSharp.so
in my bin folder to no avail.I took the error's advice and enabled LD_DEBUG and found the following:
So I copied
libSkiaSharp.so
to/usr/lib64
and then it started working! But this isn't ideal in my production environment, and I'd much rather it just look locally as opposed to deep in the system. Is there somewhere else I can put it without needing to access the AWS machine it's running on?The text was updated successfully, but these errors were encountered: