# MissingPluginException：在通道com.example.app/channel上未找到方法的实现：插件未在Android/iOS上注册

- **ID:** `flutter/plugin-not-implemented-android-ios`
- **领域:** flutter
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

Flutter插件的原生代码未在Android MainActivity或iOS AppDelegate中正确注册。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Flutter 3.22 | active | — | — |
| Android 14 | active | — | — |
| iOS 17 | active | — | — |

## 解决方案

1. ```
   For Android: In android/app/src/main/kotlin/.../MainActivity.kt, ensure the plugin is registered in the FlutterEngine. Example: override fun configureFlutterEngine(flutterEngine: FlutterEngine) { super.configureFlutterEngine(flutterEngine); flutterEngine.plugins.add(MyPlugin()) }
   ```
2. ```
   For iOS: In ios/Runner/AppDelegate.swift, ensure GeneratedPluginRegistrant.register(with: self) is called in application(_:didFinishLaunchingWithOptions:). If not, add it.
   ```
3. ```
   Regenerate the platform-specific code by running 'flutter pub upgrade' and then 'flutter build ios' or 'flutter build apk' to force plugin registration.
   ```

## 无效尝试

- **** — Cleaning doesn't affect native plugin registration; the issue is in the native code setup. (90% 失败率)
- **** — The error persists if the native side isn't updated to register the new version's methods. (75% 失败率)
- **** — The plugin is already declared; the issue is at the native level, not the Dart side. (85% 失败率)
