{
  "id": "android/unsatisfiedlinkerror-native-lib-not-found",
  "signature": "java.lang.UnsatisfiedLinkError: dlopen failed: library \"libmylib.so\" not found",
  "signature_zh": "java.lang.UnsatisfiedLinkError: dlopen 失败：找不到库 \"libmylib.so\"",
  "regex": "java\\.lang\\.UnsatisfiedLinkError: dlopen failed: library \"lib.*\\.so\" not found",
  "domain": "android",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Native library (.so) is missing for the device's ABI, not bundled in APK, or loaded from wrong path.",
  "root_cause_type": "generic",
  "root_cause_zh": "原生库 (.so) 缺少设备 ABI 对应的版本，未打包到 APK 中，或从错误路径加载。",
  "versions": [
    {
      "version": "Android 12 (API 31)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android 13 (API 33)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android 14 (API 34)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "NDK r26c",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Gradle 8.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Cleaning the project and rebuilding often fails because the root cause (missing ABI folder in jniLibs) persists.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Adding a random .so file from another project doesn't match the expected native API, causing different crashes.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Enabling minification (ProGuard/R8) may strip native libraries if not properly configured, making the error worse.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Place the correct .so file for each target ABI under app/src/main/jniLibs/<abi>/libmylib.so. For example: arm64-v8a, armeabi-v7a, x86_64. Then rebuild.",
      "success_rate": 0.9,
      "how": "Place the correct .so file for each target ABI under app/src/main/jniLibs/<abi>/libmylib.so. For example: arm64-v8a, armeabi-v7a, x86_64. Then rebuild.",
      "condition": "",
      "sources": []
    },
    {
      "action": "In build.gradle (app level), add a packaging block to exclude unused ABIs: android { packagingOptions { jniLibs { useLegacyPackaging = true } } }",
      "success_rate": 0.75,
      "how": "In build.gradle (app level), add a packaging block to exclude unused ABIs: android { packagingOptions { jniLibs { useLegacyPackaging = true } } }",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using a third-party SDK, verify the SDK version supports your target ABI and update the dependency. For example, if using OpenCV, ensure you include the correct ABI in the SDK distribution.",
      "success_rate": 0.8,
      "how": "If using a third-party SDK, verify the SDK version supports your target ABI and update the dependency. For example, if using OpenCV, ensure you include the correct ABI in the SDK distribution.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Place the correct .so file for each target ABI under app/src/main/jniLibs/<abi>/libmylib.so. For example: arm64-v8a, armeabi-v7a, x86_64. Then rebuild.",
    "In build.gradle (app level), add a packaging block to exclude unused ABIs: android { packagingOptions { jniLibs { useLegacyPackaging = true } } }",
    "If using a third-party SDK, verify the SDK version supports your target ABI and update the dependency. For example, if using OpenCV, ensure you include the correct ABI in the SDK distribution."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.android.com/ndk/guides/abis",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-06-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}