question

SrinuNani avatar image
0 Votes"
SrinuNani asked WenyanZhang-MSFT commented

System.DllNotFoundException

Hi Team,

How to resolve this issue.

<PackageReference Include="Microsoft.Maui.Graphics.Skia" Version="7.0.49" />

Error:
The type initializer for 'SkiaSharp.SKImageInfo' threw an exception. Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library liblibSkiaSharp: No such file or directory



I am using netstandard2.1 project, Docker.

dotnet-maui
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @SrinuNani , May I know whether your issue has been solved or not? If not, please share it in here. We can work together to figure it out.

0 Votes 0 ·

1 Answer

WenyanZhang-MSFT avatar image
0 Votes"
WenyanZhang-MSFT answered WenyanZhang-MSFT edited

Hello @SrinuNani ,

SkiaSharp.NativeAssets.Linux and SkiaSharp.NativeAssets.Linux.NoDependencies are not supported with MAUI. You could check the Frameworks part in the NuGet Package links, the compatible target frameworks do not include net6.0-android , net6.0-ios, net6.0-maccatalyst, net6.0-windows, you can use SkiaSharp.Views instead in MAUI.

Since you add the dotnet-aspnet-core-general tag for this thread, you may want to use SkiaSharp in a BlazorWebView. If you have any other issues, please feel free to let me know.

Best Regards,
Wenyan Zhang


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Even I am using SkiaSharp namespace also same issue is coming.

0 Votes 0 ·

You could check if you have removed the SkiaSharp.NativeAssets.Linux and SkiaSharp.NativeAssets.Linux.NoDependencies NuGet packages, and install the SkiaSharp.Views NuGet package. Then you can use SkiaSharp.SKImageInfo.
In addition, would you mind providing the csproj file of your project or all NuGet packages you used so that I can investigate further?

0 Votes 0 ·