DotNet maui not working on linux for android app development

Mandeep Singh 1 Reputation point
2022-04-11T03:51:30.01+00:00

.net sdk version = 6.0.201
OS = Ubuntu 18.04.6 LTS

I created a new dotnet maui project. Then I installed maui-android workload. I opened the project with vs code but OmniSharp gives following error

`System.DllNotFoundException: Unable to load shared library 'dl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libdl: cannot open shared object file: No such file or directory
at SkiaSharp.LibraryLoader.Linux.dlopen(String path, Int32 mode)
at SkiaSharp.LibraryLoader.Linux.dlopen(String path, Boolean lazy) in D:\a\1\s\binding\Binding.Shared\LibraryLoader.cs:line 200
at SkiaSharp.LibraryLoader.LoadLibrary(String libraryName) in D:\a\1\s\binding\Binding.Shared\LibraryLoader.cs:line 129
at SkiaSharp.LibraryLoader.LoadLocalLibraryT in D:\a\1\s\binding\Binding.Shared\LibraryLoader.cs:line 30
at SkiaSharp.SkiaApi.<>c.<.cctor>b__1831_0() in D:\a\1\s\binding\Binding\SkiaApi.cs:line 15
at System.Lazy 1.ViaFactory(LazyThreadSafetyMode mode)

--- End of stack trace from previous location ---`

then I tried to build the project with dotnet build and it gives the error

dotnet/packs/Microsoft.Maui.Resizetizer.Sdk/6.0.200- preview.14.5099/targets/Microsoft.Maui.Resizetizer.targets(475,9): error MAUI0000: System.DllNotFoundException: Unable to load shared library 'dl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libdl: cannot open shared object file: No such file or directory

I set the environment variable LD_DEBUG=libs and again run the dotnet build then there is the following error
dotnet/packs/Microsoft.Android.Sdk.Linux/31.0.200-preview.14.106/targets/Microsoft.Android.Sdk.Tooling.targets(32,5): error XA0111: Unsupported version of AAPT2 found at path

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,960 questions
{count} votes