Compartilhar via


Erro/Advertência XA1023 do .NET para Android

Mensagens de exemplo

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

Questão

O Google descontinuou o compilador DX DEX em favor do compilador D8 DEX. Em 1º de fevereiro de 2021, o DX não fará mais parte do SDK do Android ou do Android Studio.

O Compilador DX DEX não terá suporte no .NET 6 ou superior, nem no .NET para Android 12.4 e superior.

Solução

Atualize a $(AndroidDexTool) propriedade MSBuild para d8 selecionar o Compilador DEX D8. Essa propriedade corresponde à configuração do compilador Dex nas páginas de propriedades do projeto do Visual Studio. Como alternativa, remova <AndroidDexTool> do arquivo .csproj para permitir que o build selecione o valor d8padrão.