{
  "id": "android/ndk-cmake-toolchain-architecture-mismatch",
  "signature": "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.",
  "signature_zh": "CMake 错误：/path/to/android-ndk-r26c/build/cmake/android.toolchain.cmake：XX（消息）：无效的 Android STL：c++_shared。STL 'c++_shared' 不支持目标架构 'mips'。仅支持 'none' 和 'system'。",
  "regex": "CMake Error.*Invalid Android STL.*not supported for target architecture.*mips",
  "domain": "android",
  "category": "build_error",
  "subcategory": null,
  "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.",
  "root_cause_type": "generic",
  "root_cause_zh": "NDK 的 CMake 工具链配置为针对已弃用或不支持的架构（例如 MIPS）使用该 ABI 不可用的 STL 类型，通常是由于构建脚本中的 `ANDROID_ABI` 或 `APP_ABI` 设置不正确。",
  "versions": [
    {
      "version": "NDK r26c",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "NDK r25b",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.22.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "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.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The error is a configuration issue, not a cache issue. Rebuilding will reproduce the same error if the ABI setting is unchanged.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "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' } } }`",
      "success_rate": 0.9,
      "how": "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' } } }`",
      "condition": "",
      "sources": []
    },
    {
      "action": "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`.",
      "success_rate": 0.85,
      "how": "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`.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "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' } } }`",
    "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`."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.android.com/ndk/guides/cmake",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2024-04-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}