Edit

.NET for Android error ADB0020

Example messages

error ADB0020: The package does not support the CPU architecture of this device.

Issue

ADB0020 means that the built Android APK did not contain a matching Android architecture for the emulator or device it was deployed to.

This message indicates that adb (Android Debug Bridge) reported an INSTALL_FAILED_CPU_ABI_INCOMPATIBLE or INSTALL_FAILED_NO_MATCHING_ABIS error. adb is part of the Android SDK and is used internally by .NET for Android to communicate with Android emulators and devices. Learn more about adb from the Android documentation.

Solution

Set the RuntimeIdentifier or RuntimeIdentifiers MSBuild property to include a .NET RID whose Android ABI matches the device:

  • android-arm packages the armeabi-v7a ABI.
  • android-arm64 packages the arm64-v8a ABI.
  • android-x64 packages the x86_64 ABI.

For example, the following .NET 11 setting includes all supported CoreCLR architectures:

<PropertyGroup>
  <RuntimeIdentifiers>android-arm;android-arm64;android-x64</RuntimeIdentifiers>
</PropertyGroup>

Android NativeAOT is experimental and supports the same three RIDs.

Implementation notes

Note that nothing in the open source https://github.com/dotnet/android repository emits ADB0020, as features such as debugging and "fast deployment" are implemented in the proprietary .NET for Android additions.