.NET for Android 错误 XA0035

问题

.NET for Android 无法确定应用程序的目标Android ABIs,这些目标是由.csproj文件指定的。

解决方案

在 Visual Studio 或其他文本编辑器中打开项目文件,并确保 MSBuild 属性中的所有RuntimeIdentifiers值都有效:

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

在 .NET 11 中,CoreCLR 支持这三个 RID。 Android NativeAOT 处于实验阶段,并支持相同的一组功能。

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

示例消息

error XA0035: Unable to determine the Android ABI from the value 'XYZ'. Edit the project file in a text editor and set the 'RuntimeIdentifiers' MSBuild property to contain only valid identifiers for the Android platform.