{
  "id": "flutter/platform-exception-camera-permission",
  "signature": "PlatformException(camera_error, Camera access denied, null, null)",
  "signature_zh": "平台异常（相机错误，相机访问被拒绝，空，空）",
  "regex": "PlatformException\\(camera_error.*Camera access denied",
  "domain": "flutter",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "The app attempted to access the camera on iOS or Android without the required runtime permission being granted by the user.",
  "root_cause_type": "generic",
  "root_cause_zh": "应用尝试在 iOS 或 Android 上访问相机，但用户未授予所需的运行时权限。",
  "versions": [
    {
      "version": "flutter 3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "flutter 3.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "camera 0.10.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "permission_handler 11.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding only the Android permission in AndroidManifest.xml without requesting runtime permission",
      "why_fails": "On Android 6.0+ and iOS 10+, runtime permission prompt is required; manifest declaration alone is insufficient.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Calling camera plugin directly without checking permission status first",
      "why_fails": "The plugin throws the exception immediately if permission is denied; no fallback handling is provided.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use the permission_handler package to request camera permission before initializing the camera. Implement a permission check flow that shows a rationale dialog if permission is permanently denied.",
      "success_rate": 0.92,
      "how": "Use the permission_handler package to request camera permission before initializing the camera. Implement a permission check flow that shows a rationale dialog if permission is permanently denied.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Wrap camera initialization in a try-catch block and handle the PlatformException gracefully, showing an error message to the user.",
      "success_rate": 0.85,
      "how": "Wrap camera initialization in a try-catch block and handle the PlatformException gracefully, showing an error message to the user.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "使用 permission_handler 包在初始化相机之前请求相机权限。实现权限检查流程，如果权限被永久拒绝，则显示理由对话框。",
    "将相机初始化包装在 try-catch 块中，优雅地处理 PlatformException，并向用户显示错误消息。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pub.dev/packages/camera",
  "official_doc_section": null,
  "error_code": "camera_error",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-02-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}