{
  "id": "flutter/dart-ffi-abi-mismatch",
  "signature": "Invalid argument(s): Could not load native library: incompatible ABI version",
  "signature_zh": "无效参数：无法加载原生库：ABI版本不兼容",
  "regex": "Invalid argument\\(s\\): Could not load native library:.*incompatible ABI version",
  "domain": "flutter",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "The native library (.so file) was compiled for a different Android ABI (e.g., arm64-v8a vs armeabi-v7a) than the device's architecture, or the NDK version used to compile the library is incompatible with the Flutter engine's NDK.",
  "root_cause_type": "generic",
  "root_cause_zh": "原生库（.so文件）是针对与设备架构不同的Android ABI（例如arm64-v8a与armeabi-v7a）编译的，或者用于编译库的NDK版本与Flutter引擎的NDK不兼容。",
  "versions": [
    {
      "version": "Flutter 3.7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Flutter 3.10.6",
      "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"
    },
    {
      "version": "Android NDK r23b",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Add all ABI filters to build.gradle: ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'",
      "why_fails": "This includes unsupported ABIs and may cause crashes on devices that don't support them; the real issue is a mismatch, not missing ABIs.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Recompile the native library with the same NDK version as Flutter's bundled NDK",
      "why_fails": "Flutter does not bundle a fixed NDK; the version depends on the Android SDK installation. This fix may break after SDK updates.",
      "fail_rate": 0.55,
      "condition": "",
      "sources": []
    },
    {
      "action": "Set minSdkVersion to 21 to force 64-bit only",
      "why_fails": "This does not resolve ABI versioning issues; it only restricts the device set and may exclude older devices.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Specify the correct ABI filter in android/app/build.gradle under defaultConfig: ndk { abiFilters 'arm64-v8a', 'armeabi-v7a' } and ensure the .so files are placed in the correct jniLibs directory structure.",
      "success_rate": 0.9,
      "how": "Specify the correct ABI filter in android/app/build.gradle under defaultConfig: ndk { abiFilters 'arm64-v8a', 'armeabi-v7a' } and ensure the .so files are placed in the correct jniLibs directory structure.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a consistent NDK version across the project by setting android.ndkVersion in android/gradle.properties, e.g., ndkVersion = '23.1.7779620'",
      "success_rate": 0.85,
      "how": "Use a consistent NDK version across the project by setting android.ndkVersion in android/gradle.properties, e.g., ndkVersion = '23.1.7779620'",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using a prebuilt library, verify the ABI with readelf -A lib.so and match it to the target device's architecture (e.g., arm64-v8a for 64-bit ARM)",
      "success_rate": 0.8,
      "how": "If using a prebuilt library, verify the ABI with readelf -A lib.so and match it to the target device's architecture (e.g., arm64-v8a for 64-bit ARM)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Specify the correct ABI filter in android/app/build.gradle under defaultConfig: ndk { abiFilters 'arm64-v8a', 'armeabi-v7a' } and ensure the .so files are placed in the correct jniLibs directory structure.",
    "Use a consistent NDK version across the project by setting android.ndkVersion in android/gradle.properties, e.g., ndkVersion = '23.1.7779620'",
    "If using a prebuilt library, verify the ABI with readelf -A lib.so and match it to the target device's architecture (e.g., arm64-v8a for 64-bit ARM)"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.flutter.dev/development/platform-integration/c-interop",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-02-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}