Sdílet prostřednictvím


Chyba nebo upozornění .NET pro Android XA1023

Ukázkové zprávy

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'.

Problém

Společnost Google označila kompilátor DX DEX za zastaralý ve prospěch kompilátoru D8 DEX. 1. února 2021 už nebude DX součástí sady Android SDK nebo Android Studio.

Dx DEX Compiler nebude podporován v .NET 6 nebo vyšší, ani v .NET pro Android 12.4 a vyšší.

Řešení

Aktualizujte vlastnost $(AndroidDexTool) MSBuild na d8 pro výběr kompilátoru D8 DEX. Tato vlastnost odpovídá nastavení kompilátoru Dex na stránkách vlastností projektu sady Visual Studio. Případně odeberte <AndroidDexTool> ze souboru .csproj a nechte sestavení vybrat výchozí hodnotu d8.