{
  "id": "flutter/platform-view-assertion-error",
  "signature": "Platform view assertion failure: vertical sync disabled",
  "signature_zh": "平台视图断言失败：垂直同步已禁用",
  "regex": "Platform view assertion failure: vertical sync disabled",
  "domain": "flutter",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Hybrid composition platform views cause assertion failure when the framework attempts to render with vertical sync disabled, often due to background isolate rendering or headless mode.",
  "root_cause_type": "generic",
  "root_cause_zh": "混合组合平台视图在框架尝试在垂直同步禁用时渲染时引发断言失败，通常是由于后台隔离渲染或无头模式。",
  "versions": [
    {
      "version": "Flutter 3.10.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Flutter 3.13.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android 12+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "iOS 16+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Disable hybrid composition by setting AndroidViewSurface.mode = AndroidViewSurfaceMode.graphics",
      "why_fails": "This reverts to virtual display mode which has its own rendering bugs and memory leaks, and does not address the root cause of the vertical sync issue.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Set enableImplicitScrolling to false on all platform view widgets",
      "why_fails": "Implicit scrolling is unrelated to vertical sync; this change breaks scrolling behavior without fixing the assertion.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Upgrade to Flutter 3.16+ without any other changes",
      "why_fails": "The assertion persists in newer versions if the platform view is still used in a background isolate context.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure platform views are only created on the main isolate. Wrap platform view creation in a check: if (Isolate.current == Isolate.main) { /* create view */ } else { /* fallback or send to main isolate */ }",
      "success_rate": 0.85,
      "how": "Ensure platform views are only created on the main isolate. Wrap platform view creation in a check: if (Isolate.current == Isolate.main) { /* create view */ } else { /* fallback or send to main isolate */ }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use virtual display mode instead of hybrid composition by setting AndroidViewSurface.mode = AndroidViewSurfaceMode.graphics in the AndroidManifest.xml metadata",
      "success_rate": 0.75,
      "how": "Use virtual display mode instead of hybrid composition by setting AndroidViewSurface.mode = AndroidViewSurfaceMode.graphics in the AndroidManifest.xml metadata",
      "condition": "",
      "sources": []
    },
    {
      "action": "Disable headless mode in Flutter engine by setting --enable-headless-rendering=false in run arguments",
      "success_rate": 0.7,
      "how": "Disable headless mode in Flutter engine by setting --enable-headless-rendering=false in run arguments",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure platform views are only created on the main isolate. Wrap platform view creation in a check: if (Isolate.current == Isolate.main) { /* create view */ } else { /* fallback or send to main isolate */ }",
    "Use virtual display mode instead of hybrid composition by setting AndroidViewSurface.mode = AndroidViewSurfaceMode.graphics in the AndroidManifest.xml metadata",
    "Disable headless mode in Flutter engine by setting --enable-headless-rendering=false in run arguments"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.flutter.dev/platform-integration/platform-views",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "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": []
}