Coder Social home page Coder Social logo

Crash when NativeAOT enabled about fluenticons HOT 5 OPEN

shatyuka avatar shatyuka commented on July 22, 2024
Crash when NativeAOT enabled

from fluenticons.

Comments (5)

davidxuang avatar davidxuang commented on July 22, 2024

我的最小化 demo 在 AOT 下起不来,也看不到 stack trace

是资源文件被错误剪裁掉了吗?建议可以用 HxD 之类的工具看看生成的 exe 有没有正确包括两个 ttf 文件

from fluenticons.

shatyuka avatar shatyuka commented on July 22, 2024

确认了字体文件是有打包进exe的。
而且在xaml里指定Segoe字体是可以运行的:

<StackPanel>
    <ic:SymbolIcon Symbol="Home" />
    <ic:SymbolIcon Symbol="Home" UseSegoeMetrics="True"/>
</StackPanel>

BuildAvaloniaApp 里调用 UseSegoeMetrics() 就会崩溃

from fluenticons.

davidxuang avatar davidxuang commented on July 22, 2024

AOT 要加些啥东西,怎么查 trace?我这边 demo 起不来。

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <TrimMode>copyused</TrimMode>
    <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
    <PublishAot>true</PublishAot>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Avalonia" Version="11.0.*" />
    <PackageReference Include="Avalonia.Desktop" Version="11.0.*" />
    <PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.*" />
    <PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.*" />
    <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
    <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.*" />
    <PackageReference Include="FluentIcons.Avalonia" Version="1.1.*" />
    <!-- <PackageReference Include="SkiaSharp" Version="3.0.0-preview.0.132" /> -->
  </ItemGroup>

  <ItemGroup>
    <TrimmerRootDescriptor Include=".\TrimmerRoots.xml" />
  </ItemGroup>
</Project>
<linker>
    <!-- App -->
    <assembly fullname="AvaloniaDemo" preserve="All" />
    <!-- Avalonia Themes -->
    <assembly fullname="Avalonia.Themes.Fluent" preserve="All" />
</linker>

from fluenticons.

shatyuka avatar shatyuka commented on July 22, 2024

csproj里加<PublishAot>true</PublishAot>
我用Rider直接运行就可以看到崩溃堆栈

from fluenticons.

davidxuang avatar davidxuang commented on July 22, 2024

上游 bug。参见链接 issue。
Upstream bug. See linked isssue.

from fluenticons.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.