Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugs] Run error in ArchLinux #1

Closed
zxp19821005 opened this issue Sep 4, 2023 · 13 comments
Closed

[bugs] Run error in ArchLinux #1

zxp19821005 opened this issue Sep 4, 2023 · 13 comments

Comments

@zxp19821005
Copy link

$ ./src/ImageFanReloaded-Avalonia-Linux-x64/ImageFanReloaded-Avalonia       
You must install or update .NET to run this application.

App: /home/zxp-endeavouros/.cache/paru/clone/imagefanreloaded-avalonia-bin/src/ImageFanReloaded-Avalonia-Linux-x64/ImageFanReloaded-Avalonia
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64)
.NET location: /usr/share/dotnet

The following frameworks were found:
  7.0.10 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.0&arch=x64&rid=endeavouros-x64

Then I installed the dotnet-runtime-6.0 by

sudo pacman -Sy dotnet-runtime-6.0

and I run the program again,I got these errors:

$ ./src/ImageFanReloaded-Avalonia-Linux-x64/ImageFanReloaded-Avalonia
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 ImageFanReloaded.Program.Main(String[] args) in C:\Repositories\imagefanreloaded\ImageFanReloaded-Avalonia\Program.cs:line 10
[1]    244527 IOT instruction (core dumped)  ./src/ImageFanReloaded-Avalonia-Linux-x64/ImageFanReloaded-Avalonia
@mihnea-radulescu
Copy link
Owner

Thank you very much for raising this issue!

The error stems from an unresolved bug in the Avalonia framework that is used by the image viewer.

There appears to be a workaround specifically for Arch Linux, which requires the font ttf-dejavu to be installed.

Please let me know if this workaround solves the matter for you.

@zxp19821005
Copy link
Author

Still got errors.
The PKGBUILD file you can see: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=imagefanreloaded-avalonia-bin
When I add the ttf-dejavu,and make it,I got this:

$ imagefanreloaded-avalonia
Failure processing application bundle; possible file corruption.
Arithmetic overflow while reading bundle.
A fatal error occurred while processing application bundle

@mihnea-radulescu
Copy link
Owner

Thanks again for your input!

As I don't have Arch Linux installed, I cannot personally reproduce this packaging issue.

However, I've found the information below, essentially suggesting the flag options=('!strip' 'staticlibs') added to PKGBUILD:

Please keep me posted if this fixes the build.

@zxp19821005
Copy link
Author

Still got errors:

$ chmod +x src/ImageFanReloaded-Avalonia-Linux-x64/ImageFanReloaded-Avalonia 

# zxp-endeavouros @ 3993EndeavourOS in ~/.cache/paru/clone/imagefanreloaded-avalonia-bin on git:master x [9:53:19] 
$ ./src/ImageFanReloaded-Avalonia-Linux-x64/ImageFanReloaded-Avalonia 
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 ImageFanReloaded.Program.Main(String[] args) in C:\Repositories\imagefanreloaded\ImageFanReloaded-Avalonia\Program.cs:line 10
[1]    1781868 IOT instruction (core dumped)  ./src/ImageFanReloaded-Avalonia-Linux-x64/ImageFanReloaded-Avalonia

After build:

$ ./pkg/imagefanreloaded-avalonia-bin/opt/imagefanreloaded-avalonia/ImageFanReloaded-Avalonia 
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 ImageFanReloaded.Program.Main(String[] args) in C:\Repositories\imagefanreloaded\ImageFanReloaded-Avalonia\Program.cs:line 10
[1]    1780301 IOT instruction (core dumped)

@zxp19821005
Copy link
Author

Is there any configure file?

@mihnea-radulescu
Copy link
Owner

I've considered bypassing the Avalonia "System.InvalidOperationException: Default font family name can't be null or empty." bug by setting a default font family for Linux.

This idea, however, does not help matters, as no font can be relied to always be present on every Linux system, and Avalonia does not allow for a generic font family to be specified, such as "sans-serif".

The only option remaining, unless the Avalonia bug gets fixed, is to include the package ttf-ms-fonts in the PKGBUILD.

Hopefully this will fix this issue.

@zxp19821005
Copy link
Author

I've add the dependicy ttf-ms-fonts,but still got the same error.

@zxp19821005
Copy link
Author

zxp19821005 commented Sep 7, 2023

I met the same problem in ULogViewer (carina-studio/ULogViewer#21 the author has solved it,maybe you can ask him for help.

@mihnea-radulescu
Copy link
Owner

Hi @zxp19821005,

I have released today a new version of the software, which includes a partial fix to the issue you encountered.

Could you please re-test with the new version?

@zxp19821005
Copy link
Author

zxp19821005 commented Oct 10, 2023

Version:1.2023.10.09
Still error:

$ imagefanreloaded-avalonia
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 ImageFanReloaded.Program.Main(String[] args) in C:\Repositories\imagefanreloaded\ImageFanReloaded-Avalonia\Program.cs:line 10
[1]    213128 IOT instruction (core dumped)  imagefanreloaded-avalonia

@memorydream
Copy link

Hi, I saw this issue link from AvaloniaILSpy, you can try export LC_CTYPE=en_US.UTF-8 before run Avalonia application, or set in /etc/locale.conf, it should can resolve font issue

If you are running KDE Plasma, sholud check system settings, not locale.conf, please see https://wiki.archlinux.org/title/locale#My_system_is_still_using_wrong_language

@zxp19821005
Copy link
Author

@memorydream Thanks a lot,fixed it now.
@mihnea-radulescu Thank you,it run well now.

@mihnea-radulescu
Copy link
Owner

Thank you very much @memorydream and @zxp19821005 for providing and confirming the fix to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants