{
  "id": "flutter/incompatible-abi-version",
  "signature": "Invalid argument(s): Could not load native library: /data/app/.../lib/arm64/libflutter.so: incompatible ABI version",
  "signature_zh": "Invalid argument(s): 无法加载原生库: /data/app/.../lib/arm64/libflutter.so: ABI 版本不兼容",
  "regex": "Could not load native library: .*libflutter\\.so.*incompatible ABI version",
  "domain": "flutter",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "The Flutter engine native library (libflutter.so) was compiled for a different Android ABI than the device's CPU architecture, often due to building with an incorrect target platform or using a mismatched NDK version.",
  "root_cause_type": "generic",
  "root_cause_zh": "Flutter 引擎原生库 (libflutter.so) 是为与设备 CPU 架构不同的 Android ABI 编译的，通常是由于使用错误的目标平台构建或 NDK 版本不匹配。",
  "versions": [
    {
      "version": "Flutter 3.16.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Flutter 3.22.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android NDK r25c",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Set 'android:extractNativeLibs=\"true\"' in AndroidManifest.xml",
      "why_fails": "This flag controls APK packaging but does not fix the ABI mismatch; the library still has the wrong ABI.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Add all ABIs to the build.gradle abiFilters",
      "why_fails": "Including all ABIs increases APK size but doesn't resolve an incompatible ABI; the device still gets the wrong library if the build targets a different ABI.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Delete the build folder and rebuild without cleaning",
      "why_fails": "Without cleaning, the stale library persists; 'flutter clean' is required to remove the cached native libraries.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Run 'flutter clean' and rebuild with the correct target platform. For ARM64 devices, use 'flutter build apk --target-platform android-arm64'. Example:\n  flutter clean\n  flutter build apk --target-platform android-arm64 --release",
      "success_rate": 0.85,
      "how": "Run 'flutter clean' and rebuild with the correct target platform. For ARM64 devices, use 'flutter build apk --target-platform android-arm64'. Example:\n  flutter clean\n  flutter build apk --target-platform android-arm64 --release",
      "condition": "",
      "sources": []
    },
    {
      "action": "Update the Android NDK version to match Flutter's requirements. In android/app/build.gradle, set:\n  ndkVersion \"25.1.8937393\"\nThen run 'flutter clean' and rebuild.",
      "success_rate": 0.8,
      "how": "Update the Android NDK version to match Flutter's requirements. In android/app/build.gradle, set:\n  ndkVersion \"25.1.8937393\"\nThen run 'flutter clean' and rebuild.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Enable ABI splitting in android/app/build.gradle to generate separate APKs for each ABI:\n  android {\n    splits {\n      abi {\n        enable true\n        reset()\n        include 'arm64-v8a', 'armeabi-v7a', 'x86_64'\n      }\n    }\n  }",
      "success_rate": 0.75,
      "how": "Enable ABI splitting in android/app/build.gradle to generate separate APKs for each ABI:\n  android {\n    splits {\n      abi {\n        enable true\n        reset()\n        include 'arm64-v8a', 'armeabi-v7a', 'x86_64'\n      }\n    }\n  }",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "运行 'flutter clean' 并使用正确的目标平台重新构建。对于 ARM64 设备，使用 'flutter build apk --target-platform android-arm64'。示例：\n  flutter clean\n  flutter build apk --target-platform android-arm64 --release",
    "更新 Android NDK 版本以匹配 Flutter 要求。在 android/app/build.gradle 中设置：\n  ndkVersion \"25.1.8937393\"\n然后运行 'flutter clean' 并重新构建。",
    "在 android/app/build.gradle 中启用 ABI 分割，为每个 ABI 生成单独的 APK：\n  android {\n    splits {\n      abi {\n        enable true\n        reset()\n        include 'arm64-v8a', 'armeabi-v7a', 'x86_64'\n      }\n    }\n  }"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.flutter.dev/deployment/android#abi-splitting",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}