Skip to main content
An Application Binary Interface (ABI) defines the machine code interface for your native libraries. Understanding ABIs is crucial for distributing Android applications with native code across different device architectures.

What is an ABI?

An ABI specifies:
  • Instruction set: The CPU architecture (ARM, x86, RISC-V)
  • Calling conventions: How functions receive parameters and return values
  • Register usage: Which CPU registers are used for what purposes
  • Memory layout: Data structure sizes, alignment, and byte ordering
  • System call interface: How to invoke kernel functionality
When you compile native code, you must specify the target ABI. The resulting .so file will only run on devices with that ABI.

Supported ABIs

Android NDK supports the following ABIs:

arm64-v8a

Architecture: ARMv8-A 64-bitUsage: Modern Android devices (Android 5.0+)Characteristics:
  • 64-bit architecture with larger address space
  • Access to more CPU registers (31 general-purpose registers)
  • Advanced SIMD with NEON (128-bit vectors)
  • Hardware cryptography extensions
  • Most common ABI for recent Android devices
Typical devices:
  • Flagship phones from 2015 onwards
  • Mid-range and budget phones from 2017 onwards
  • All devices shipping with Android 10+
As of 2024, arm64-v8a is the dominant ABI, representing over 85% of active Android devices.

Deprecated ABIs

The following ABIs are no longer supported:
If your app targets these ABIs, you must upgrade to supported ABIs or use an older NDK version (not recommended).

ABI compatibility

Fallback behavior

Android can run 32-bit libraries on 64-bit devices:
  • arm64-v8a devices can run armeabi-v7a libraries
  • x86_64 devices can run x86 libraries
If your APK contains any 64-bit library, Android will only load 64-bit libraries. Mixing ABIs within a single APK requires providing all libraries for all included ABIs.

Library dependencies

All native dependencies must match ABIs:

APK configuration strategies

Fat APKs (single APK)

One APK containing libraries for all ABIs:
  • Simple distribution (one APK for all devices)
  • No app bundle required
  • Works with all distribution channels
  • Easier version management
Typical APK size impact:

Split APKs (multiple APKs)

Generate separate APKs per ABI:
  • Smaller download size per device
  • Users only get required ABI
  • Reduced storage on device
Google Play generates optimized APKs per device:
  • Automatic optimization by Google Play
  • Smallest possible download size
  • Users get only their device’s ABI
  • Simplest configuration
  • Supports dynamic delivery
App Bundle is the recommended approach for Google Play distribution. Users automatically receive the optimal APK for their device.
For most applications in 2024:
Only support 64-bit ARM:
Coverage: ~85-90% of active devicesRationale:
  • Smallest APK size
  • All Android 10+ devices
  • Trade off: Excludes older/budget devices
Support all major ABIs:
Coverage: Nearly 100% of devicesRationale:
  • Maximum device compatibility
  • Supports emulators natively
  • Chrome OS devices
  • Trade off: Larger APK (use App Bundle to mitigate)
For development builds:
Rationale:
  • Faster build times during development
  • Full ABI coverage for release builds

Detecting ABI at runtime

You can check which ABI your app is running on:
Build.CPU_ABI and Build.CPU_ABI2 are deprecated. Use Build.SUPPORTED_ABIS instead.

ABI-specific optimizations

You can write ABI-specific code using compiler defines:

Troubleshooting

Error: UnsatisfiedLinkError: dalvik.system.PathClassLoader couldn't find "libnative.so"Causes:
  1. Library not built for device’s ABI
  2. Missing dependencies for that ABI
  3. Library in wrong directory
Solutions:
Verify your build.gradle includes the target ABI:
Error: App crashes on 64-bit devices but works on 32-bitCause: APK contains arm64-v8a libraries but missing some dependencies in arm64-v8aSolution: Ensure all native libraries exist for all included ABIs:
Problem: APK too large with multiple ABIsSolutions:
  1. Use Android App Bundle (recommended)
  2. Use APK splits
  3. Remove unnecessary ABIs (x86/x86_64 if not needed)
  4. Use ProGuard/R8 to remove unused code

Next steps

For the latest ABI support and device statistics, check the Android Developer Dashboard.