unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.92k stars 722 forks source link

[Linux] Unable to run newest preview template Skia.Gtk #4020

Closed mikart143 closed 4 years ago

mikart143 commented 4 years ago

Current behavior

Unable to run Skia.Gtk template created via:

dotnet new unoapp -o TestUno

Message:

/snap/dotnet-sdk/current/dotnet /home/xxx/Projects/TestUno/TestUno.Skia.Gtk/bin/Debug/netcoreapp3.1/TestUno.Skia.Gtk.dll Unhandled exception. System.TypeInitializationException: The type initializer for 'Gtk.Application' threw an exception. ---> System.DllNotFoundException: Gtk: libgtk-3-0.dll, libgtk-3.so.0, libgtk-3.0.dylib, gtk-3.dll at GLibrary.Load(Library library) at Gtk.Application..cctor() --- End of inner exception stack trace --- at Gtk.Application.Init() at Uno.UI.Runtime.Skia.GtkHost.Run() at TestUno.Skia.Gtk.Program.Main(String[] args) in /home/mikart/Projects/TestUno/TestUno.Skia.Gtk/Program.cs:line 21 Process finished with exit code 134.

Expected behavior

To be able to see app on my linux machine

How to reproduce it (as minimally and precisely as possible)

dotent new unoapp -o Test

and then build and run Skia.Gtk

Workaround

None

Environment

Manjaro - Linux

Nuget Package:

Nuget Package Version(s):

Affected platform(s):

IDE:

Relevant plugins:

Anything else we need to know?

mikart143 commented 4 years ago

Fixed! Do not use dot net core from snap. Snap sandbox app and prevent from using system libs

jeromelaban commented 4 years ago

Thanks for the report. You will be able to use the "self-contained" .NET 5/3.1 mode once https://github.com/dotnet/runtime/issues/1634 is fixed (looks like it'll be in .NET 5 RC1), and a specific snap configuration that we'll document soon.

sharpninja commented 4 years ago

I get the exact same behavior:

System.TypeInitializationException
  HResult=0x80131534
  Message=The type initializer for 'Gtk.Application' threw an exception.
  Source=GtkSharp
  StackTrace:
   at Gtk.Application.Init()
   at Uno.UI.Runtime.Skia.GtkHost.Run()
   at Win10.UI.FaceOff.Uno.Skia.Gtk.Program.Main(String[] args) in e:\GitHub\Win10UiFaceOff\Win10.UI.FaceOff.Uno\Win10.UI.FaceOff.Uno.Skia.Gtk\Program.cs:line 21

  This exception was originally thrown at this call stack:
    GLibrary.Load(Library)
    Gtk.Application.Application()

Inner Exception 1:
DllNotFoundException: Gtk: libgtk-3-0.dll, libgtk-3.so.0, libgtk-3.0.dylib, gtk-3.dll
PS E:\GitHub\Win10UiFaceOff> dotnet --version
5.0.100-rc.2.20479.15

Dependencies:

image

System Info:

OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19042 N/A Build 19042
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: AMD64 Family 23 Model 8 Stepping 2 AuthenticAMD ~3700 Mhz
BIOS Version:              American Megatrends Inc. P1.10, 4/19/2018
Windows Directory:         C:\WINDOWS
System Directory:          C:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume3
System Locale:             en-us;English (United States)
Input Locale:              en-us;English (United States)
Time Zone:                 (UTC-06:00) Central Time (US & Canada)
Total Physical Memory:     32,698 MB
Available Physical Memory: 8,028 MB
Virtual Memory: Max Size:  42,426 MB
Virtual Memory: Available: 10,704 MB
Virtual Memory: In Use:    31,722 MB
Page File Location(s):     C:\pagefile.sys
Hotfix(s):                 7 Hotfix(s) Installed.
                           [01]: KB4578968
                           [02]: KB4562830
                           [03]: KB4566785
                           [04]: KB4570334
                           [05]: KB4577266
                           [06]: KB4580325
                           [07]: KB4580364
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.

EDIT: Error happens compiled for both netcoreapp3.1 and net50