Unhandled Exception: PlatformExc

2021-03-17  本文已影响0人  李小轰
问题描述

flutter-application项目中,我们开发维护了一个flutter-plugin用于业务逻辑与原生的交互,原生模块中使用了flutterView,并新建flutterEngine与flutterView相绑定,dart层我们用到了一个三方库用于播放视频 video-player。

现象:

只有在使用新建的flutterEngine进行onAttachedToEngine,才会报错,使用plugin自动关联的engine进行绑定时能正常播放

报错信息:

Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)

问题分析
image.png
处理方案

将我们的new engine与video-player插件进行关联


image.png
具体代码:
newEngine.plugins.add(VideoPlayerPlugin()) //VideoPlayerPlugin由video-player

启发:


image.png
上一篇 下一篇

猜你喜欢

热点阅读