{
  "id": "flutter/insufficient-permission-scope",
  "signature": "PlatformException: PERMISSION_DENIED, The operation was denied because the permission scope is insufficient",
  "signature_zh": "PlatformException：PERMISSION_DENIED，由于权限范围不足，操作被拒绝",
  "regex": "PlatformException: PERMISSION_DENIED, The operation was denied because the permission scope is insufficient",
  "domain": "flutter",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "A platform-specific permission (e.g., camera, location, storage) was requested but the user granted only a limited scope, or the permission was not declared in the app manifest.",
  "root_cause_type": "generic",
  "root_cause_zh": "请求了平台特定权限（如摄像头、位置、存储），但用户仅授予了有限范围，或者未在应用清单中声明该权限。",
  "versions": [
    {
      "version": "Flutter 3.19",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Dart 3.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android 14",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "iOS 17.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Over-declaring permissions may cause app store rejection or user distrust; also, runtime permission requests still require user consent and proper handling.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Ignoring the result means the app proceeds without the required permission, leading to the same exception when the operation is attempted.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Lowering compileSdkVersion may introduce security vulnerabilities and prevent use of newer APIs; it also does not resolve runtime permission denials on newer devices.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use the permission_handler package to explicitly request the permission and check the status before performing the operation. Example: `final status = await Permission.camera.request(); if (status.isGranted) { // proceed } else { // show rationale }`",
      "success_rate": 0.9,
      "how": "Use the permission_handler package to explicitly request the permission and check the status before performing the operation. Example: `final status = await Permission.camera.request(); if (status.isGranted) { // proceed } else { // show rationale }`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Declare the exact permission in AndroidManifest.xml (e.g., <uses-permission android:name=\"android.permission.CAMERA\" />) and in Info.plist (e.g., NSCameraUsageDescription).",
      "success_rate": 0.95,
      "how": "Declare the exact permission in AndroidManifest.xml (e.g., <uses-permission android:name=\"android.permission.CAMERA\" />) and in Info.plist (e.g., NSCameraUsageDescription).",
      "condition": "",
      "sources": []
    },
    {
      "action": "For Android 14+ granular media permissions, request each sub-permission (e.g., ACCESS_MEDIA_LOCATION) separately using the `photo_manager` or similar package that handles scoped storage.",
      "success_rate": 0.8,
      "how": "For Android 14+ granular media permissions, request each sub-permission (e.g., ACCESS_MEDIA_LOCATION) separately using the `photo_manager` or similar package that handles scoped storage.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use the permission_handler package to explicitly request the permission and check the status before performing the operation. Example: `final status = await Permission.camera.request(); if (status.isGranted) { // proceed } else { // show rationale }`",
    "Declare the exact permission in AndroidManifest.xml (e.g., <uses-permission android:name=\"android.permission.CAMERA\" />) and in Info.plist (e.g., NSCameraUsageDescription).",
    "For Android 14+ granular media permissions, request each sub-permission (e.g., ACCESS_MEDIA_LOCATION) separately using the `photo_manager` or similar package that handles scoped storage."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.flutter.dev/development/data-and-backend/reading-writing-images",
  "official_doc_section": null,
  "error_code": "PERMISSION_DENIED",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-03-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}