skip to Main Content

I am implementing a mobile app using Flutter. When I try to run the app on iOS real device from Xcode, I get this error:

[VERBOSE-2:FlutterObservatoryPublisher.mm(115)] Failed to register observatory port with mDNS.

The app runs fine as long as the device is connected to the Mac and running from Xcode. But when I try to open it from the device Home Screen directly, it crashes.

This issue happens on iOS 14.0 and higher. It works fine on iOS 13.x.

6

Answers


  1. It’s a few days I’m dealing (without a solution) with this problem.
    If you have any useful information, here you can share it (or, maybe, find it).

    At the moment, I’m working on a workaround, that I will share in that thread ASAP.

    Login or Signup to reply.
  2. I debug an (object-c based) flutter project, I like to launch it in Xcode, I find it more fast launching app in Xcode than ‘flutter run’ command in terminal. then I like to ‘flutter attach’ to it for hot reload.

    I encountered this error very often.

    It seems to touch the AppDelegate.m file forcing it to be re-compiled can fix this problem….

    Login or Signup to reply.
  3. I was able to fix it. This is how I did it.

    For you to fix this error. open the iPhone simulator then run your flutter project. then go to System Preferences > Security & Privacy > General Tab. You need to give permission to iproxy(I can’t remember the file name but you need to give that file permission to run). After it has successfully run on your simulator. Plug your iPhone follow the steps again.

    Login or Signup to reply.
  4. Add this property info.plist.

    <key>NSBonjourServices</key>
    <array>
        <string>_dartobservatory._tcp</string>
    </array>
    
    Login or Signup to reply.
  5. Here is the original documentation

    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.

    In Info.plist only add the key NSBonjourServices and set the value to an array with the string _dartobservatory._tcp. Note Xcode will display this as “Bonjour services”.

    Optionally, add the key NSLocalNetworkUsageDescription set to your desired customized permission dialog text.

    The original documentation mentions that this shouldn’t be used in the Release version and also provides some instructions how to enable only for Debug releases.

    Warning: This service must not be enabled in the Release version of your app, or you may experience App Store rejections.

    Login or Signup to reply.
  6. Flutter Official Documentation

    According the Flutter official documentation:

    On iOS 14 and higher, enable the Dart multicast DNS service in the Debug version of your app…

    One way to do this is to maintain a separate copy of your app’s Info.plist per build configuration.

    1. Rename your app’s Info.plist to Info-Debug.plist. Make a copy of it called Info-Release.plist and add it to your Xcode project.

    enter image description here

    1. In Info-Debug.plist only add the key NSBonjourServices and set the value to an array with the string _dartobservatory._tcp. Note Xcode will display this as “Bonjour services”.

    enter image description here

    1. In your target’s build settings, change the Info.plist File (INFOPLIST_FILE) setting path from path/to/Info.plist to path/to/Info-$(CONFIGURATION).plist.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search