{
  "id": "android/gradle-transform-error-jetifier-missing-mapping",
  "signature": "Failed to transform artifact 'support-v4.aar' using Jetifier. Reason: Cannot find a mapping for support class 'android/support/v4/app/FragmentActivity'",
  "signature_zh": "使用 Jetifier 转换工件 'support-v4.aar' 失败。原因：找不到支持类 'android/support/v4/app/FragmentActivity' 的映射",
  "regex": "Failed to transform artifact.*using Jetifier.*Cannot find a mapping for support class",
  "domain": "android",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "Jetifier cannot map an old support library class to AndroidX because the mapping file is incomplete or the library version is too old.",
  "root_cause_type": "generic",
  "root_cause_zh": "Jetifier 无法将旧的支持库类映射到 AndroidX，因为映射文件不完整或库版本太旧。",
  "versions": [
    {
      "version": "Android Gradle Plugin 7.4.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android Gradle Plugin 8.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android Gradle Plugin 8.1.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Delete .gradle cache and rebuild",
      "why_fails": "Cache is not the issue; the mapping file is missing or library is incompatible.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Add Jetifier mapping manually in gradle.properties: `android.jetifier.blacklist=.*`",
      "why_fails": "Blacklisting doesn't solve missing mapping; it just skips the library, potentially causing runtime errors.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Update all dependencies to latest versions",
      "why_fails": "The specific library 'support-v4.aar' may not have an AndroidX equivalent; updating other deps doesn't help.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Exclude the problematic library from Jetifier: in build.gradle, add `android.jetifier.blacklist = [\"support-v4.aar\"]` and manually migrate its usage to AndroidX equivalents like `androidx.legacy:legacy-support-v4:1.0.0`.",
      "success_rate": 0.9,
      "how": "Exclude the problematic library from Jetifier: in build.gradle, add `android.jetifier.blacklist = [\"support-v4.aar\"]` and manually migrate its usage to AndroidX equivalents like `androidx.legacy:legacy-support-v4:1.0.0`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Update the library to an AndroidX version: replace `com.android.support:support-v4:28.0.0` with `androidx.legacy:legacy-support-v4:1.0.0` in dependencies.",
      "success_rate": 0.92,
      "how": "Update the library to an AndroidX version: replace `com.android.support:support-v4:28.0.0` with `androidx.legacy:legacy-support-v4:1.0.0` in dependencies.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add a custom Jetifier mapping: create a file `jetifier-mappings.txt` with `android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity` and reference it via `android.jetifier.mappingsFile`.",
      "success_rate": 0.85,
      "how": "Add a custom Jetifier mapping: create a file `jetifier-mappings.txt` with `android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity` and reference it via `android.jetifier.mappingsFile`.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Exclude the problematic library from Jetifier: in build.gradle, add `android.jetifier.blacklist = [\"support-v4.aar\"]` and manually migrate its usage to AndroidX equivalents like `androidx.legacy:legacy-support-v4:1.0.0`.",
    "Update the library to an AndroidX version: replace `com.android.support:support-v4:28.0.0` with `androidx.legacy:legacy-support-v4:1.0.0` in dependencies.",
    "Add a custom Jetifier mapping: create a file `jetifier-mappings.txt` with `android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity` and reference it via `android.jetifier.mappingsFile`."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.android.com/jetpack/androidx/migrate",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}