.NET for Android 錯誤 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.

Issue

專案中 AndroidAotMode MSBuild 屬性設定為實驗Hybrid值,並且包含 MSBuild 屬性中的armeabi-v7aAndroidSupportedAbis。 如果在 armeabi-v7a 裝置上發現應用程式設定為 Hybrid,則應用程式在啟動時會中止,因此建置過程會錯誤退出。

解決方案

若應用程式需要 armeabi-v7a 裝置相容性,應將 MSBuild 屬性設定為 Normal 或從專案檔案中完全移除。 若要調整 MSBuild 屬性的值 AndroidAotMode ,請在文字編輯器中編輯專案檔案。

如果應用程式不需要 armeabi-v7a 裝置相容性,請在 Visual Studio 專案屬性頁面中取消選取 armeabi-v7a 目標 ABI,以解決建置錯誤。

在 Visual Studio 中,可於專案屬性頁面Android 選項進階區塊中,調整目標 ABI 的支援架構

在 Mac 版 Visual Studio 中,可以在專案屬性頁面的 Android 建置區的 進階 標籤下的 Supported ABIs 中調整目標 ABI。

或者,你可以在文字編輯器中編輯專案檔案,並手動從 MSBuild 屬性中移除armeabi-v7aAndroidSupportedAbis