.NET for Android 警告 XA0036

问题

$(AndroidSupportedAbis).NET 6 及更高版本不再支持 MSBuild 属性。

解决方案

在 Visual Studio 或其他文本编辑器中打开项目文件并删除<AndroidSupportedAbis/>。 请改用 RuntimeIdentifiers MSBuild 属性:

<PropertyGroup>
  <RuntimeIdentifiers>android-arm;android-arm64;android-x64</RuntimeIdentifiers>
</PropertyGroup>

在 .NET 11 中,CoreCLR 支持这三个 RID。 Android NativeAOT 处于实验阶段,并支持相同的一组功能。 android-x86 RID 通过 .NET 10 Mono 工具链提供,但在 .NET 11 中不可用。

有关详细信息,请参阅 有关运行时标识符 的Microsoft文档。

示例消息

warning XA0036: The 'AndroidSupportedAbis' MSBuild property is no longer supported. Edit the project file in a text editor, remove any uses of 'AndroidSupportedAbis', and use the 'RuntimeIdentifiers' MSBuild property instead.