我尝试发布适用于 Android 的 AvaloniaUI 应用程序。我使用以下设置创建“文件夹”发布配置文件:
然后我点击“发布”。
出现以下错误:
Error XA1030: The 'RunAOTCompilation' MSBuild property is only supported when trimming is enabled. Edit the project file in a text editor to set 'PublishTrimmed' to 'true' for this build configuration.
我将以下行添加到 .csproj 文件中:
<PublishTrimmed>true</PublishTrimmed>
然后再次单击“发布”。出现以下错误:
error NETSDK1098: Applications published to a single-file are required to use the application host. You must either set PublishSingleFile to false or set UseAppHost to true.
现在我将以下行添加到 .csproj:
<UseAppHost>true</UseAppHost>
然后再次单击“发布”,但错误并未隐藏。我移动以下几行:
<SelfContained>true</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishTrimmed>true</PublishTrimmed>
<UseAppHost>true</UseAppHost>
Error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'android-arm64'.
下一步该做什么?如何添加“应用程序主机”?我花了几个小时但没有解决这个问题。