次の方法で共有


Android 用 .NET エラー/警告 XA1023

メッセージの例

error XA1023: Using the DX DEX Compiler is not supported. Please set the DEX compiler to 'd8' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidDexTool' MSBuild property to 'd8'.
warning XA1023: Using the DX DEX Compiler is deprecated. Please set the DEX compiler to 'd8' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidDexTool' MSBuild property to 'd8'.
error XA1023: Using the DX DEX Compiler is not supported in .NET for Android projects that target .NET 6 or higher. Please set the DEX compiler to 'd8' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidDexTool' MSBuild property to 'd8'.

問題点

Google は 、D8 DEX コンパイラを優先して DX DEX コンパイラを非推奨にしました。 2021 年 2 月 1 日に、DX は Android SDK または Android Studio の一部ではなくなります。

DX DEX コンパイラは、.NET 6 以降、Android 12.4 以降の .NET ではサポートされません。

ソリューション

$(AndroidDexTool) MSBuild プロパティを d8 に更新して、D8 DEX コンパイラを選択します。 このプロパティは、Visual Studio プロジェクトのプロパティ ページの Dex コンパイラ 設定に対応します。 または、<AndroidDexTool> ファイルからを削除して、ビルドで既定値のd8を選択できるようにします。