Flutter(iOS):原生跳转flutter页面出现Unhandled Exception: MissingPluginException解决方案

  • (void)pushFlutterViewController_EventChannel {
    FlutterViewController* flutterViewController = [[FlutterViewController alloc] initWithProject:nil nibName:nil bundle:nil];
    [flutterViewController setInitialRoute:@"test?id=47"];
    flutterViewController.splashScreenView.hidden = YES;
    [GeneratedPluginRegistrant registerWithRegistry:flutterViewController];
    // self.navigationController.navigationBarHidden = YES;
    [self.navigationController pushViewController:flutterViewController animated:NO];
    }
    在原生中需要跳转到flutter指定页现出现MissingPluginException错误:


    image.png

    解决方法-手动注册该插件:
    [GeneratedPluginRegistrant registerWithRegistry:flutterViewController];

你可能感兴趣的:(Flutter(iOS):原生跳转flutter页面出现Unhandled Exception: MissingPluginException解决方案)