{
  "id": "flutter/platform-channel-method-not-implemented",
  "signature": "MissingPluginException: No implementation found for method getBatteryLevel on channel com.example.battery",
  "signature_zh": "MissingPluginException：在通道 com.example.battery 上找不到方法 getBatteryLevel 的实现",
  "regex": "MissingPluginException: No implementation found for method \\S+ on channel \\S+",
  "domain": "flutter",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "The native platform plugin does not register the expected method handler for the given channel, often due to missing plugin registration or incorrect method name.",
  "root_cause_type": "generic",
  "root_cause_zh": "原生平台插件未为指定通道注册预期的方法处理器，通常是由于缺少插件注册或方法名称错误。",
  "versions": [
    {
      "version": "Flutter 3.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Dart 3.4",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android SDK 34",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "iOS 17",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Rebuilding the entire app without cleaning caches",
      "why_fails": "Stale build artifacts may still reference old plugin registrations; a clean build is needed.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "Manually editing generated plugin registrant files",
      "why_fails": "Registrant files are auto-generated and overwritten on rebuild; manual edits are lost.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding the plugin again in pubspec.yaml without checking native setup",
      "why_fails": "The plugin is already declared; the issue is in native code registration, not Dart dependency.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure the plugin's native code registers the method channel. For Android, check MainActivity.kt: GeneratedPluginRegistrant.registerWith(flutterEngine). For iOS, check AppDelegate.swift: GeneratedPluginRegistrant.register(with: self).",
      "success_rate": 0.85,
      "how": "Ensure the plugin's native code registers the method channel. For Android, check MainActivity.kt: GeneratedPluginRegistrant.registerWith(flutterEngine). For iOS, check AppDelegate.swift: GeneratedPluginRegistrant.register(with: self).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Run 'flutter clean' and 'flutter pub get' to reset build cache and regenerate registrant files.",
      "success_rate": 0.9,
      "how": "Run 'flutter clean' and 'flutter pub get' to reset build cache and regenerate registrant files.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Verify the method name in the native handler matches exactly what Flutter calls (case-sensitive).",
      "success_rate": 0.75,
      "how": "Verify the method name in the native handler matches exactly what Flutter calls (case-sensitive).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "确保插件的原生代码注册了方法通道。对于 Android，检查 MainActivity.kt：GeneratedPluginRegistrant.registerWith(flutterEngine)。对于 iOS，检查 AppDelegate.swift：GeneratedPluginRegistrant.register(with: self)。",
    "运行 'flutter clean' 和 'flutter pub get' 以重置构建缓存并重新生成注册文件。",
    "验证原生处理程序中的方法名称与 Flutter 调用的完全匹配（区分大小写）。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.flutter.dev/platform-integration/platform-channels",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2024-02-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}