VitalElement / AvalonStudio

Cross platform IDE and Shell
GNU Lesser General Public License v3.0
1.6k stars 232 forks source link

Default font family name can't be null or empty #749

Open NyasakiAT opened 4 years ago

NyasakiAT commented 4 years ago

[mwalk@arch netcoreapp3.1]$ ./AvalonStudio Unhandled exception. System.InvalidOperationException: Default font family name can't be null or empty. at Avalonia.Media.FontManager..ctor(IFontManagerImpl platformImpl) at Avalonia.Media.FontManager.get_Current() at Avalonia.Rendering.RendererBase..ctor(Boolean useManualFpsCounting) at Avalonia.Rendering.DeferredRenderer..ctor(IRenderRoot root, IRenderLoop renderLoop, ISceneBuilder sceneBuilder, IDispatcher dispatcher, IDeferredRendererLock rendererLock) at Avalonia.X11.X11Window.CreateRenderer(IRenderRoot root) at Avalonia.Controls.TopLevel..ctor(ITopLevelImpl impl, IAvaloniaDependencyResolver dependencyResolver) at Avalonia.Controls.WindowBase..ctor(IWindowBaseImpl impl, IAvaloniaDependencyResolver dependencyResolver) at Avalonia.Controls.WindowBase..ctor(IWindowBaseImpl impl) at Avalonia.Controls.Window..ctor(IWindowImpl impl) at Avalonia.Controls.Window..ctor() at AvalonStudio.Shell.Controls.MetroWindow..ctor() in /home/mwalk/tmp/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Controls/MetroWindow.cs:line 63 at AvalonStudio.MainWindow..ctor() in /home/mwalk/tmp/AvalonStudio/AvalonStudio/AvalonStudio/MainWindow.xaml.cs:line 15 at AvalonStudio.App.OnFrameworkInitializationCompleted() in /home/mwalk/tmp/AvalonStudio/AvalonStudio/AvalonStudio/App.paml.cs:line 18 at Avalonia.Controls.AppBuilderBase1.Setup() at Avalonia.Controls.AppBuilderBase1.SetupWithLifetime(IApplicationLifetime lifetime) at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) at AvalonStudio.Shell.Shell.StartShellApp[TAppBuilder](TAppBuilder builder, String appName, ShellAppMainDelegate main, String[] args, IFactory layoutFactory) in /home/mwalk/tmp/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Shell.cs:line 17 at AvalonStudio.Program.Main(String[] args) in /home/mwalk/tmp/AvalonStudio/AvalonStudio/AvalonStudio/Program.cs:line 32 Aborted (core dumped) [mwalk@arch netcoreapp3.1]$ ./AvalonStudio Unhandled exception. System.InvalidOperationException: Default font family name can't be null or empty. at Avalonia.Media.FontManager..ctor(IFontManagerImpl platformImpl) at Avalonia.Media.FontManager.get_Current() at Avalonia.Rendering.RendererBase..ctor(Boolean useManualFpsCounting) at Avalonia.Rendering.DeferredRenderer..ctor(IRenderRoot root, IRenderLoop renderLoop, ISceneBuilder sceneBuilder, IDispatcher dispatcher, IDeferredRendererLock rendererLock) at Avalonia.X11.X11Window.CreateRenderer(IRenderRoot root) at Avalonia.Controls.TopLevel..ctor(ITopLevelImpl impl, IAvaloniaDependencyResolver dependencyResolver) at Avalonia.Controls.WindowBase..ctor(IWindowBaseImpl impl, IAvaloniaDependencyResolver dependencyResolver) at Avalonia.Controls.WindowBase..ctor(IWindowBaseImpl impl) at Avalonia.Controls.Window..ctor(IWindowImpl impl) at Avalonia.Controls.Window..ctor() at AvalonStudio.Shell.Controls.MetroWindow..ctor() in /home/mwalk/tmp/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Controls/MetroWindow.cs:line 63 at AvalonStudio.MainWindow..ctor() in /home/mwalk/tmp/AvalonStudio/AvalonStudio/AvalonStudio/MainWindow.xaml.cs:line 15 at AvalonStudio.App.OnFrameworkInitializationCompleted() in /home/mwalk/tmp/AvalonStudio/AvalonStudio/AvalonStudio/App.paml.cs:line 18 at Avalonia.Controls.AppBuilderBase1.Setup() at Avalonia.Controls.AppBuilderBase1.SetupWithLifetime(IApplicationLifetime lifetime) at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) at AvalonStudio.Shell.Shell.StartShellApp[TAppBuilder](TAppBuilder builder, String appName, ShellAppMainDelegate main, String[] args, IFactory layoutFactory) in /home/mwalk/tmp/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Shell.cs:line 17 at AvalonStudio.Program.Main(String[] args) in /home/mwalk/tmp/AvalonStudio/AvalonStudio/AvalonStudio/Program.cs:line 32 Aborted (core dumped)

Project was build normally and I attempted to run it Fresh Archlinux install with i3

0x56696B commented 3 years ago

I have the same problem here. Fonts are installed, but still gives a error

OS: Manjaro Linux (fully updated as of 11th Sep 2020) Dotnet Version 3.1.107 Error Message:

Unhandled exception. System.InvalidOperationException: Default font family name can't be null or empty. at Avalonia.Media.FontManager..ctor(IFontManagerImpl platformImpl) at Avalonia.Media.FontManager.get_Current() at Avalonia.Rendering.RendererBase..ctor(Boolean useManualFpsCounting) at Avalonia.Rendering.DeferredRenderer..ctor(IRenderRoot root, IRenderLoop renderLoop, ISceneBuilder sceneBuilder, IDispatcher dispatcher, IDeferredRendererLock rendererLock) at Avalonia.X11.X11Window.CreateRenderer(IRenderRoot root) at Avalonia.Controls.TopLevel..ctor(ITopLevelImpl impl, IAvaloniaDependencyResolver dependencyResolver) at Avalonia.Controls.WindowBase..ctor(IWindowBaseImpl impl, IAvaloniaDependencyResolver dependencyResolver) at Avalonia.Controls.WindowBase..ctor(IWindowBaseImpl impl) at Avalonia.Controls.Window..ctor(IWindowImpl impl) at Avalonia.Controls.Window..ctor() at AvalonStudio.Shell.Controls.MetroWindow..ctor() in /opt/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Controls/MetroWindow.cs:line 63 at AvalonStudio.MainWindow..ctor() in /opt/AvalonStudio/AvalonStudio/AvalonStudio/MainWindow.xaml.cs:line 15 at AvalonStudio.App.OnFrameworkInitializationCompleted() in /opt/AvalonStudio/AvalonStudio/AvalonStudio/App.paml.cs:line 18 at Avalonia.Controls.AppBuilderBase1.Setup() at Avalonia.Controls.AppBuilderBase1.SetupWithLifetime(IApplicationLifetime lifetime) at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) at AvalonStudio.Shell.Shell.StartShellApp[TAppBuilder](TAppBuilder builder, String appName, ShellAppMainDelegate main, String[] args, IFactory layoutFactory) in /opt/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Shell.cs:line 17 at AvalonStudio.Program.Main(String[] args) in /opt/AvalonStudio/AvalonStudio/AvalonStudio/Program.cs:line 32 zsh: abort (core dumped) ./AvalonStudio

ErdajtSopjani commented 9 months ago

Same issue here in Arch Linux:

❯ dotnet run
/home/erdajtt/P9/code/c#/projects/test/ViewLocator.cs(12,20): warning CS8602: Dereference of a possibly null reference. [/home/erdajtt/P9/code/c#/projects/test/test.csproj]
Unhandled exception. System.InvalidOperationException: Default font family name can't be null or empty.
   at Avalonia.Media.FontManager..ctor(IFontManagerImpl platformImpl)
   at Avalonia.Media.FontManager.get_Current()
   at Avalonia.AppBuilder.<>c__DisplayClass62_0.<ConfigureFonts>b__0(AppBuilder appBuilder)
   at Avalonia.AppBuilder.SetupUnsafe()
   at Avalonia.AppBuilder.Setup()
   at Avalonia.AppBuilder.SetupWithLifetime(IApplicationLifetime lifetime)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode)
   at test.Program.Main(String[] args) in /home/erdajtt/P9/code/c#/projects/test/Program.cs:line 13
ErdajtSopjani commented 9 months ago

To resolve this issue install ttf-ms-fonts from the AUR. (in arch based distros)

yay -S ttf-ms-fonts

And for ubuntu based distros install ttf-mscorefonts-installer from the repos.