无法发布适用于 Android 的 AvaloniaUI 应用程序 - 错误 NETSDK1084 没有可用于指定 RuntimeIdentifier 的应用程序主机

问题描述 投票:0回答:1

我尝试发布适用于 Android 的 AvaloniaUI 应用程序。我使用以下设置创建“文件夹”发布配置文件: Publish profile settings

然后我点击“发布”。

出现以下错误:

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>
  • 进入FolderProfile.pubxml,然后再次单击“发布”。出现以下错误:
Error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'android-arm64'.

下一步该做什么?如何添加“应用程序主机”?我花了几个小时但没有解决这个问题。

此处描述的答案没有帮助。 编辑:对于@jdweng:这是我的runtimeconfig.json 文件。

runtimeconfig.json

c# android .net-8.0 avaloniaui
1个回答
0
投票

© www.soinside.com 2019 - 2024. All rights reserved.