Passakorn Choosuk
Posted on October 25, 2021
[Problem]
After trying to launch my-flutter-app on iOS14 iPhone, then it displayed an issue about Failed to register observatory port with mDNS. This is the full error message in the console
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. For more information, see https://flutter.dev/docs/development/add-to-app/ios/project-setup#local-network-privacy-permissions
[Solution]
From the link above, we just follow the instruction and the problem will be solved.
1 Rename Info.plist to Info-Debug.plist and copy this file to create a new file called Info-Release.plist
2 Open Runner.xcworkspace with Xcode and remove Info.plist then add Info-Debug.plist and Info-Release.plist
3 Add key NSBonjourServices with value _dartobservatory._tcp
4 Change Info.plist file to Runner/Info-$(CONFIGURATION).plist from Runner/Info.plist
5 Delete Info-Release.plist in Build Phase menu
6 Run the app again and there is no compliant about local network permission anymore
Posted on October 25, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
August 14, 2024