Monday, April 5, 2021

How to resolve: Unable to load shared library 'libSkiaSharp' when trying to run an AvaloniaUI .NET 5 app

I was trying to run a simple .NET 5 application that uses the cross platform AvaloniaUI graphical user interface library on Ubuntu 20.04. More information about AvaloniaUI can be found on https://avaloniaui.net/. But after executing the command $ dotnet run, the exception error messages appear complaining about a missing libSkiaSharp shared object file, as shown in the screenshot below.

 

After some investigations, I managed to resolve the problem by removing the dotnet SDK binaries that come from the Ubuntu's Snap PPA repositories, that are installed when the following command is executed:


Instead of using Ubuntu's repo, the official Microsoft installer from https://dotnet.microsoft.com/download/dotnet/5.0 should be used instead. 

After installing the official SDK, running the application brings up the application's graphical user interface without any error messages, as shown below.


No comments: