2024-06-15 Flutter 插件項(xiàng)目 flutter attach 卡在Waiting for a connection from Flutter on xxx...

在安卓進(jìn)行插件調(diào)試很順利,但是在iOS端,有時(shí)可以,有時(shí)一直等待,十分影響開發(fā)效率。網(wǎng)上找了很多方法,最終也還是沒有解決,今天在調(diào)試插件啟動日志時(shí),發(fā)現(xiàn)了如下提示:

[VERBOSE-2:FlutterDartVMServicePublisher.mm(124)] 
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 '_dartVmService._tcp' value to the 'NSBonjourServices' key in your Info.plist for the Debug/Profile configurations. 
For more information, see https://flutter.dev/docs/development/add-to-app/ios/project-setup#local-network-privacy-permissions

很好,之前官網(wǎng)上并沒有提到需要加 _dartVmService 這個(gè)值,只是提到加_bonjour._tcp,于是果斷在NSBonjourServices 再添加_dartVmService,問題完美解決。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容