{
  "id": "android/gradle-task-assemble-debug-failed-jetifier",
  "signature": "Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/common/collect/ImmutableList.class",
  "signature_zh": "任务 ':app:transformClassesWithJarMergingForDebug' 执行失败。> com.android.build.api.transform.TransformException: java.util.zip.ZipException: 重复条目：com/google/common/collect/ImmutableList.class",
  "regex": "Execution failed for task '.*transformClassesWithJarMergingForDebug'.*duplicate entry:.*",
  "domain": "android",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "Duplicate class found in multiple dependencies, often due to Jetifier converting both support libraries and AndroidX, or two libraries shipping the same class.",
  "root_cause_type": "generic",
  "root_cause_zh": "多个依赖中发现重复类，通常是由于 Jetifier 同时转换了支持库和 AndroidX，或者两个库提供了相同的类。",
  "versions": [
    {
      "version": "Android Gradle Plugin 8.1",
      "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"
    },
    {
      "version": "Jetifier 1.0.0-beta10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android Studio Hedgehog 2023.1.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Disabling Jetifier entirely may cause other libraries to break if they still depend on support libraries.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Adding an exclude statement in packagingOptions for the duplicate class often masks the root cause and may remove needed functionality.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using a newer version of the dependency without checking its transitive dependencies may introduce more duplicates.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Run `./gradlew :app:dependencies --configuration debugCompileClasspath` to identify which libraries bring the duplicate class. Then exclude the transitive dependency in build.gradle: implementation('com.example:library:1.0') { exclude group: 'com.google.guava', module: 'guava' }",
      "success_rate": 0.85,
      "how": "Run `./gradlew :app:dependencies --configuration debugCompileClasspath` to identify which libraries bring the duplicate class. Then exclude the transitive dependency in build.gradle: implementation('com.example:library:1.0') { exclude group: 'com.google.guava', module: 'guava' }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Upgrade all dependencies to their AndroidX versions and disable Jetifier in gradle.properties: android.jetifier.enabled=false",
      "success_rate": 0.8,
      "how": "Upgrade all dependencies to their AndroidX versions and disable Jetifier in gradle.properties: android.jetifier.enabled=false",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the `com.google.guava:guava:30.1.1-android` variant which avoids conflicts with other Android libraries.",
      "success_rate": 0.75,
      "how": "Use the `com.google.guava:guava:30.1.1-android` variant which avoids conflicts with other Android libraries.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Run `./gradlew :app:dependencies --configuration debugCompileClasspath` to identify which libraries bring the duplicate class. Then exclude the transitive dependency in build.gradle: implementation('com.example:library:1.0') { exclude group: 'com.google.guava', module: 'guava' }",
    "Upgrade all dependencies to their AndroidX versions and disable Jetifier in gradle.properties: android.jetifier.enabled=false",
    "Use the `com.google.guava:guava:30.1.1-android` variant which avoids conflicts with other Android libraries."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.android.com/studio/build/jetifier",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-08-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}