# CMake Error at /path/to/android-ndk-r26c/build/cmake/android.toolchain.cmake:XX (message): Invalid Android STL: c++_shared. The STL 'c++_shared' is not supported for target architecture 'mips'. Only 'none' and 'system' are supported.

- **ID:** `android/ndk-cmake-toolchain-architecture-mismatch`
- **Domain:** android
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 88%

## Root Cause

NDK's CMake toolchain is configured to target a deprecated or unsupported architecture (e.g., MIPS) with an STL type that is not available for that ABI, often due to incorrect `ANDROID_ABI` or `APP_ABI` setting in build scripts.

## Version Compatibility

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

## Workarounds

1. **Update your `build.gradle` (Module: app) to set `abiFilters` to supported architectures only, removing MIPS: `android { defaultConfig { ndk { abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' } } }`** (90% success)
   ```
   Update your `build.gradle` (Module: app) to set `abiFilters` to supported architectures only, removing MIPS: `android { defaultConfig { ndk { abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' } } }`
   ```
2. **If using a custom CMake toolchain file, set `set(ANDROID_ABI "arm64-v8a")` before including the NDK toolchain, and ensure `APP_ABI` in `Application.mk` (if using ndk-build) does not include `mips`.** (85% success)
   ```
   If using a custom CMake toolchain file, set `set(ANDROID_ABI "arm64-v8a")` before including the NDK toolchain, and ensure `APP_ABI` in `Application.mk` (if using ndk-build) does not include `mips`.
   ```

## Dead Ends

- **** — The same error occurs because the architecture (MIPS) does not support any c++ STL variant except 'none' or 'system'. The issue is the ABI, not the STL variant. (90% fail)
- **** — The error is a configuration issue, not a cache issue. Rebuilding will reproduce the same error if the ABI setting is unchanged. (95% fail)
