Android için .NET hatası/uyarısı XA1023

Örnek iletiler

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

Sorun

Google, D8 DEX Derleyicisi'nin yerine DX DEX Derleyicisi'ni kullanım dışı bırakmıştır. 1 Şubat 2021'de, DX artık Android SDK veya Android Studio'nun bir parçası olmayacaktır.

DX DEX Derleyicisi.NET 6 veya üzeri sürümlerde veya Android 12.4 ve üzeri için .NET'te desteklenmez.

Çözüm

$(AndroidDexTool) MSBuild özelliğini d8 olarak güncelleyin ve D8 DEX Derleyicisi'ni seçin. Bu özellik, Visual Studio proje özellikleri sayfalarındaki Dex derleyicisi ayarına karşılık gelir. Alternatif olarak, derlemenin varsayılan değeri seçmesine izin vermek için <AndroidDexTool> dosyasından kaldırınd8.