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:- ARM (64-bit)
- ARM (32-bit)
- x86 (64-bit)
- x86 (32-bit)
- RISC-V (64-bit)
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
- 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:| ABI | Removed | Notes |
|---|---|---|
| armeabi | NDK r17 | Generic ARMv5TE, very old devices |
| mips | NDK r17 | MIPS 32-bit, never widely adopted |
| mips64 | NDK r17 | MIPS 64-bit, never widely adopted |
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
Library dependencies
All native dependencies must match ABIs:APK configuration strategies
Fat APKs (single APK)
One APK containing libraries for all ABIs:- Advantages
- Disadvantages
- Simple distribution (one APK for all devices)
- No app bundle required
- Works with all distribution channels
- Easier version management
Split APKs (multiple APKs)
Generate separate APKs per ABI:- Advantages
- Disadvantages
- Smaller download size per device
- Users only get required ABI
- Reduced storage on device
Android App Bundle (AAB) - Recommended
Google Play generates optimized APKs per device:- Advantages
- Disadvantages
- 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.
Recommended ABI configuration
For most applications in 2024:Standard configuration (recommended)
Standard configuration (recommended)
Support the two most common ABIs:Coverage: ~99% of devicesRationale:
- arm64-v8a: All modern devices (required by Play Store)
- armeabi-v7a: Older devices still in use
- Omit x86/x86_64: Very few physical devices, emulator can use ARM translation
Minimal configuration (64-bit only)
Minimal configuration (64-bit only)
Only support 64-bit ARM:Coverage: ~85-90% of active devicesRationale:
- Smallest APK size
- All Android 10+ devices
- Trade off: Excludes older/budget devices
Comprehensive configuration
Comprehensive configuration
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)
Development/testing configuration
Development/testing configuration
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:- Kotlin
- Java
ABI-specific optimizations
You can write ABI-specific code using compiler defines:Troubleshooting
Library not found errors
Library not found errors
Error: Verify your build.gradle includes the target ABI:
UnsatisfiedLinkError: dalvik.system.PathClassLoader couldn't find "libnative.so"Causes:- Library not built for device’s ABI
- Missing dependencies for that ABI
- Library in wrong directory
Mixed 32/64-bit libraries
Mixed 32/64-bit libraries
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:
Large APK size
Large APK size
Problem: APK too large with multiple ABIsSolutions:
- Use Android App Bundle (recommended)
- Use APK splits
- Remove unnecessary ABIs (x86/x86_64 if not needed)
- Use ProGuard/R8 to remove unused code
Next steps
- Learn about bionic C library differences
- Explore build systems for multi-ABI compilation
- Understand native development best practices
For the latest ABI support and device statistics, check the Android Developer Dashboard.