适用于 Android 的 .NET 错误 XA1025

示例消息

error XA1025: The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild
property is not currently compatible with the armeabi-v7a target ABI. To
continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect
the armeabi-v7a target ABI in the Visual Studio project property pages or edit
the project file in a text editor and remove 'armeabi-v7a' from the
'AndroidSupportedAbis' MSBuild property.

问题

项目将 AndroidAotMode MSBuild 属性设置为实验Hybrid值,并且还包括 MSBuild 属性中的AndroidSupportedAbisarmeabi-v7a。 对于在 armeabi-v7a 设备上启动时中止的应用程序,如果它们使用AndroidAotMode设置为Hybrid构建,一旦检测到此配置,构建将退出并显示错误。

解决方案

如果应用需要 armeabi-v7a 设备兼容性,则应将 MSBuild 属性设置为 Normal,或者将其完全从项目文件中删除。 若要调整 MSBuild 属性的值 AndroidAotMode ,请在文本编辑器中编辑项目文件。

如果应用不需要与armeabi-v7a设备的兼容性,则取消选择Visual Studio项目属性页中的armeabi-v7a目标ABI来解决构建错误。

在 Visual Studio 中,可以在项目属性页的“Android 选项”选项卡的“高级”部分的“支持的架构”下调整目标 ABI。

在 Visual Studio for Mac 中,可以在项目属性页的“Android 生成”部分的“高级”选项卡中的“支持的 API”下调整目标 API。

或者,在文本编辑器中编辑项目文件,并手动从 AndroidSupportedAbis MSBuild 属性中删除armeabi-v7a