# CMake Error at /path/to/android-ndk-r26c/build/cmake/android.toolchain.cmake:XX (message): Unknown ABI: arm64-v8a-hard

- **ID:** `android/ndk-cmake-unknown-abi`
- **Domain:** android
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 93%

## Root Cause

NDK r26c removed support for the 'arm64-v8a-hard' ABI variant (which had hardware floating-point optimizations) in favor of standard 'arm64-v8a'. Projects still specifying '-hard' suffix in build.gradle or CMakeLists.txt cause this error.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Android NDK r26c | active | — | — |
| Android NDK r25b | active | — | — |
| CMake 3.22.1 | active | — | — |
| Gradle 8.5 | active | — | — |

## Workarounds

1. **Change build.gradle ndk.abiFilters to use 'arm64-v8a' instead of 'arm64-v8a-hard'. Example: defaultConfig { ndk { abiFilters 'arm64-v8a', 'x86_64' } }** (95% success)
   ```
   Change build.gradle ndk.abiFilters to use 'arm64-v8a' instead of 'arm64-v8a-hard'. Example: defaultConfig { ndk { abiFilters 'arm64-v8a', 'x86_64' } }
   ```
2. **Update CMakeLists.txt to remove any -hard suffix from target_compile_options or set(CMAKE_ANDROID_ARM_MODE ARM) to ensure soft-float is used. Then clean rebuild.** (90% success)
   ```
   Update CMakeLists.txt to remove any -hard suffix from target_compile_options or set(CMAKE_ANDROID_ARM_MODE ARM) to ensure soft-float is used. Then clean rebuild.
   ```

## Dead Ends

- **Set ANDROID_ABI=arm64-v8a-hard in gradle.properties** — NDK r26c no longer recognizes this ABI string. Setting it in properties just passes the same invalid value to CMake. (95% fail)
- **Downgrade NDK to r25b** — This works temporarily but prevents using newer NDK features and security patches. Also breaks if other libraries require r26c. (60% fail)
