【发布时间】:2021-02-08 19:33:12
【问题描述】:
我最近给自己买了一台 PinePhone,并决定使用 .NET Core 5。我选择使用 Avalonia 是因为它宣传的跨平台特性。我将应用程序部署到我的手机并遇到了这个错误:
Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.
---> System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library liblibSkiaSharp: No such file or directory
at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
at SkiaSharp.SKImageInfo..cctor()
--- End of inner exception stack trace ---
at Avalonia.Skia.PlatformRenderInterface..ctor(ISkiaGpu skiaGpu, Nullable`1 maxResourceBytes)
at Avalonia.Skia.SkiaPlatform.Initialize(SkiaOptions options)
at Avalonia.SkiaApplicationExtensions.<>c__0`1.<UseSkia>b__0_0()
at Avalonia.Controls.AppBuilderBase`1.Setup()
at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
at DummyCounter.Program.Main(String[] args)
Aborted
奇怪的是,libSkiaSharp.so 库文件与可执行文件位于同一文件夹中。该文件夹是通过下面的dotnet publish 命令创建的:
dotnet publish -r alpine-arm64 DummyCounter -o ./publish
我尝试了一些不同的方法,将架构更改为 linux-musl-arm64,将应用程序部署为独立和/或单文件,但我仍然得到相同的确切结果。有没有人见过这样的东西?
【问题讨论】:
标签: .net-core embedded-linux alpine avaloniaui