{
  "id": "flutter/release-mode-debug-assert",
  "signature": "AssertionError: '!_debugAllowCreation' is not true in release mode",
  "signature_zh": "AssertionError: 在发布模式下 '!_debugAllowCreation' 不为真",
  "regex": "AssertionError: '!_debugAllowCreation' is not true",
  "domain": "flutter",
  "category": "assertion_error",
  "subcategory": null,
  "root_cause": "A debug-only assertion that checks widget creation permissions is triggered in release mode because the code path that should be disabled (e.g., a debug overlay or inspector) is still active due to a misconfigured build flag or leftover debug code.",
  "root_cause_type": "generic",
  "root_cause_zh": "一个仅限调试的断言检查小部件创建权限，在发布模式下被触发，因为本应禁用的代码路径（例如调试覆盖层或检查器）由于构建标志配置错误或遗留的调试代码仍然处于活动状态。",
  "versions": [
    {
      "version": "Flutter 3.13.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Flutter 3.22.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Dart 3.1.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Add '--debug' flag to the build command to avoid release mode",
      "why_fails": "The error occurs in release mode; using debug mode bypasses the issue but doesn't solve the root cause for production builds.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Remove all assert() statements from the codebase",
      "why_fails": "Assertions are stripped in release mode by default; the error is from Flutter's internal assertions, not user code.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Set '--no-sound-null-safety' to suppress the assertion",
      "why_fails": "Null safety is unrelated; the assertion is about widget creation permissions, not null checks.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure that debug-specific code (like debugPaintSizeEnabled or custom debug overlays) is wrapped in 'assert(() { ... }());' or conditionally compiled with 'kReleaseMode'. Example:\n  if (kDebugMode) {\n    // debug-only widget creation\n  }",
      "success_rate": 0.8,
      "how": "Ensure that debug-specific code (like debugPaintSizeEnabled or custom debug overlays) is wrapped in 'assert(() { ... }());' or conditionally compiled with 'kReleaseMode'. Example:\n  if (kDebugMode) {\n    // debug-only widget creation\n  }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Run 'flutter clean' and rebuild with 'flutter build apk --release' to ensure no stale debug artifacts remain.",
      "success_rate": 0.75,
      "how": "Run 'flutter clean' and rebuild with 'flutter build apk --release' to ensure no stale debug artifacts remain.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check for any third-party packages that may inject debug widgets in release mode; update them or exclude debug features via package configuration.",
      "success_rate": 0.7,
      "how": "Check for any third-party packages that may inject debug widgets in release mode; update them or exclude debug features via package configuration.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "确保调试特定代码（如 debugPaintSizeEnabled 或自定义调试覆盖层）包装在 'assert(() { ... }());' 中或使用 'kReleaseMode' 条件编译。示例：\n  if (kDebugMode) {\n    // 仅调试的小部件创建\n  }",
    "运行 'flutter clean' 并使用 'flutter build apk --release' 重新构建，确保没有残留的调试工件。",
    "检查可能注入调试小部件的第三方包；更新它们或通过包配置排除调试功能。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.flutter.dev/testing/debugging#debug-mode-assertions",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.8,
  "fix_success_rate": 0.72,
  "resolvable": "true",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}