Problem with SkiaSharp on Linux

Hi Aspose team,

We use Aspose.Cells 23.3.0 in our AzureFunction. Everything works fine on Windows.
On Linux, when we call new Workbook(), we get this error:

2024-04-19T09:48:26.226538934Z: [ERROR] Unhandled exception. System.TypeInitializationException: The type initializer for ‘SkiaSharp.SKObject’ threw an exception.
2024-04-19T09:48:26.226589134Z: [ERROR] —> System.DllNotFoundException: 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: liblibSkiaSharp: cannot open shared object file: No such file or directory
2024-04-19T09:48:26.226598835Z: [ERROR] at SkiaSharp.SkiaApi.sk_version_get_milestone()
2024-04-19T09:48:26.226603935Z: [ERROR] at SkiaSharp.SkiaSharpVersion.get_Native()
2024-04-19T09:48:26.226608035Z: [ERROR] at SkiaSharp.SkiaSharpVersion.CheckNativeLibraryCompatible(Boolean throwIfIncompatible)
2024-04-19T09:48:26.226611935Z: [ERROR] at SkiaSharp.SKObject…cctor()
2024-04-19T09:48:26.226615635Z: [ERROR] — End of inner exception stack trace —
2024-04-19T09:48:26.226619835Z: [ERROR] at SkiaSharp.SKObject.DeregisterHandle(IntPtr handle, SKObject instance)
2024-04-19T09:48:26.226623735Z: [ERROR] at SkiaSharp.SKObject.set_Handle(IntPtr value)
2024-04-19T09:48:26.226627335Z: [ERROR] at SkiaSharp.SKNativeObject.Dispose(Boolean disposing)
2024-04-19T09:48:26.226631035Z: [ERROR] at SkiaSharp.SKNativeObject.Finalize()
2024-04-19T09:48:26.226649635Z: [INFO] Unhandled exception on 04/19/2024 09:48:26: System.TypeInitializationException: The type initializer for ‘SkiaSharp.SKObject’ threw an exception.
2024-04-19T09:48:26.226654935Z: [INFO] —> System.DllNotFoundException: 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: liblibSkiaSharp: cannot open shared object file: No such file or directory
2024-04-19T09:48:26.226660235Z: [INFO] at SkiaSharp.SkiaApi.sk_version_get_milestone()
2024-04-19T09:48:26.226664435Z: [INFO] at SkiaSharp.SkiaSharpVersion.get_Native()
2024-04-19T09:48:26.226668435Z: [INFO] at SkiaSharp.SkiaSharpVersion.CheckNativeLibraryCompatible(Boolean throwIfIncompatible)
2024-04-19T09:48:26.226672335Z: [INFO] at SkiaSharp.SKObject…cctor()
2024-04-19T09:48:26.226676535Z: [INFO] — End of inner exception stack trace —
2024-04-19T09:48:26.226680635Z: [INFO] at SkiaSharp.SKObject.DeregisterHandle(IntPtr handle, SKObject instance)
2024-04-19T09:48:26.226684335Z: [INFO] at SkiaSharp.SKObject.set_Handle(IntPtr value)
2024-04-19T09:48:26.226687636Z: [INFO] at SkiaSharp.SKNativeObject.Dispose(Boolean disposing)
2024-04-19T09:48:26.226690936Z: [INFO] at SkiaSharp.SKNativeObject.Finalize()

This leads to container restart and as a result unexpected azure function behavior.

We use these libraries:
SkiaSharp 2.88.7
SkiaSharp.NativeAssets.Linux.NoDependencies 2.88.7

Tried different versions, 2.88.8, 2.88.6, 2.88.3, but no success.

Please, advise how to solve this issue.

@sergeykavaliou
Could you try to directly use SkiaSharp to draw an image without Aspose.Cells on AzureFunction linux?

removed new Workbook and tried this
using (SKPaint textPaint = new SKPaint { TextSize = 48 })

yes, we have the same issue.

@sergeykavaliou,

The issue may not be with Aspose.Cells. We suggest you to try browsing internet to find relevant threads/documents to figure out your issue.
e.g.
https://github.com/mono/SkiaSharp/issues/2607

Thank you! will investigate

@sergeykavaliou
You are welcome. If you have any questions, please feel free to contact us.

@sergeykavaliou ,

Also, try the solution at [BUG] Unable to load DLL 'libSkiaSharp' or one of its dependencies on Azure Functions · Issue #1001 · mono/SkiaSharp · GitHub.

Please let us know the solution if you fixed the issue on AzureFunction Linux.