{
  "id": "flutter/firebase-app-not-initialized",
  "signature": "FirebaseException: Firebase App named '[DEFAULT]' already exists",
  "signature_zh": "FirebaseException: 名为 '[DEFAULT]' 的 Firebase 应用已存在",
  "regex": "FirebaseException: Firebase App named '\\[DEFAULT\\]' already exists",
  "domain": "flutter",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Calling Firebase.initializeApp() multiple times without checking if the default app is already initialized.",
  "root_cause_type": "generic",
  "root_cause_zh": "多次调用 Firebase.initializeApp() 而未检查默认应用是否已初始化。",
  "versions": [
    {
      "version": "Flutter 3.22.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "firebase_core 2.27.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "firebase_auth 4.17.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Each call attempts to reinitialize, causing the 'already exists' error on subsequent calls.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Ignoring the error may lead to duplicate Firebase instances and unexpected behavior.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Firebase apps cannot be deleted programmatically; this approach is not supported.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check if Firebase is already initialized before calling initializeApp: `if (Firebase.apps.isEmpty) { await Firebase.initializeApp(); }`.",
      "success_rate": 0.95,
      "how": "Check if Firebase is already initialized before calling initializeApp: `if (Firebase.apps.isEmpty) { await Firebase.initializeApp(); }`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Initialize Firebase only once in the main() function before runApp: `WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); runApp(MyApp());`.",
      "success_rate": 0.9,
      "how": "Initialize Firebase only once in the main() function before runApp: `WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); runApp(MyApp());`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a singleton pattern to wrap Firebase initialization and prevent duplicate calls.",
      "success_rate": 0.85,
      "how": "Use a singleton pattern to wrap Firebase initialization and prevent duplicate calls.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Check if Firebase is already initialized before calling initializeApp: `if (Firebase.apps.isEmpty) { await Firebase.initializeApp(); }`.",
    "Initialize Firebase only once in the main() function before runApp: `WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); runApp(MyApp());`.",
    "Use a singleton pattern to wrap Firebase initialization and prevent duplicate calls."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://firebase.flutter.dev/docs/overview",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2024-04-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}