Flutter运行Ios真机时报错:Failed to register observatory port with mDNS with error 报错如下
[VERBOSE-2:FlutterObservatoryPublisher.mm(101)] Failed to register observatory port with mDNS with error -65555.
[VERBOSE-2:FlutterObservatoryPublisher.mm(103)] On iOS 14+, local network broadcast in apps need to be declared in the app's Info.plist. Debug and profile Flutter apps and modules host VM services on the local network to support debugging features such as hot reload and DevTools. To make your Flutter app or module attachable and debuggable, add a '_dartobservatory._tcp' value to the 'NSBonjourServices' key in your Info.plist for the Debug/Profile configurations.
文章图片
解决:(参考上述官方链接文档) On iOS 14 and higher, enable the Dart multicast DNS service in the Debug version of your app to add debugging functionalities such as hot-reload and DevTools via flutter attach.
- 1、将应用程序的Info.plist重命名为Info-Debug.plist。复制一个名为Info-Release.plist的副本,并将其添加到Xcode项目中。
文章图片
- 2、在Info-Debug.plist中,添加键NSBonjourServices并将值设置为 _dartobservatory._tcp
文章图片
- 3、在target’s build settings, 修改 Info.plist File 路径 path/to/Info.plist 为 path/to/Info-$(CONFIGURATION).plist.
文章图片
- 4、在 target’s -> Build Settings > Build Phases > Copy Bundle Resources build phase, 如果有Info-Release.plist 删除即可(下图我已经删除)
文章图片
推荐阅读
- ios转载|ios常用刷新页面方法
- ios转载|the device is locked 解决方法
- dio拦截器|dio拦截器 flutter_Flutter 中 Dio 拦截器
- flutter|Flutter最酷炫瀑布流实现
- Flutter|Flutter 基于Dio的网络库封装(开源项目)
- flutter|flutter实现瀑布流布局
- #|本人寻找泉州地区的iOS开发岗位(简历(欢迎评论留下联系方式))
- C++|(C++)cout格式化输出示例
- iOS|RGB、YUV、HSV和HSL区别和关联