Skip to content

flutter attach for add-to-app modules doesn't work on iOS 14, document how to add _dartobservatory._tcp to host app #63893

Closed
flutter/website
#4671

Description

@xster

Don't know if I'm holding it wrong. Ran https://github.com/flutter/samples/tree/master/add_to_app/flutter_module + https://github.com/flutter/samples/tree/master/add_to_app/ios_fullscreen on a physical iOS 14 device.

flutter attach yields Waiting for a connection from Flutter on iPhone... forever.

@jmagman can you give it a try too?

Activity

  1. added
    c: regressionIt was better in the past than it is now
    platform-iosiOS applications specifically
    toolAffects the "flutter" command-line tool. See also t: labels.
    a: existing-appsIntegration with existing apps via the add-to-app flow
    on Aug 16, 2020
  2. jmagman commented on Aug 18, 2020

    @jmagman
    Member

    I'm getting:

    2020-08-18 14:22:08.196495-0700 IOSFullScreen[343:10184] [VERBOSE-2:shell.cc(210)] Dart Error: Can't load Kernel binary: Invalid kernel binary format version.
    2020-08-18 14:22:08.196570-0700 IOSFullScreen[343:10184] [VERBOSE-2:engine.cc(219)] Could not prepare to run the isolate.
    
  3. added this to the 1.22 - August 2020 milestone on Aug 18, 2020
  4. xster commented on Aug 18, 2020

    @xster
    MemberAuthor

    @gaaclarke could I assign this one to you to investigate?

  5. gaaclarke commented on Aug 21, 2020

    @gaaclarke
    Member

    @xster or @jmagman can you list what versions of xcode / ios you were using? I'll try to get the latest previews.

    edit: fyi the latest 14 preview came out august 18th (preview 5).

  6. xster commented on Aug 22, 2020

    @xster
    MemberAuthor

    I ran into this on Xcode 12 beta 4 + iOS 14 beta 4

  7. jmagman commented on Aug 26, 2020

    @jmagman
    Member

    I think my previous Dart Error: Can't load Kernel binary: Invalid kernel binary format version. was unrelated.

    I tried this again and got:

    [  +20 ms] Connecting to service protocol: http://127.0.0.1:55036/xobuHBvn92Y=/
    [   +1 ms] DDS is currently disabled due to https://github.com/flutter/flutter/issues/62507
    [  +15 ms] Fail to connect to service protocol: http://127.0.0.1:55036/xobuHBvn92Y=/: HttpException: Connection closed before full header was received, uri =
    http://127.0.0.1:55036/xobuHBvn92Y=/ws
    [   +1 ms] Error connecting to the service protocol: failed to connect to http://127.0.0.1:55036/xobuHBvn92Y=/
    [   +2 ms] Unforwarding port ForwardedPort HOST:55036 to DEVICE:57364
    

    and then it exited. So it failed before Waiting for a connection from Flutter on iPhone...

  8. xster commented on Aug 26, 2020

    @xster
    MemberAuthor

    I'm getting

    default	22:31:55.907057-0700	IOSFullScreen	Cache loaded with 4536 pre-cached in CacheData and 44 items in CacheExtra.
    default	22:31:55.909429-0700	IOSFullScreen	Initializing connection
    default	22:31:55.909574-0700	IOSFullScreen	Removing all cached process handles
    default	22:31:55.923490-0700	IOSFullScreen	FBSWorkspace connecting to endpoint : <BSServiceConnectionEndpoint: 0x2804b5500; target: com.apple.frontboard.systemappservices; service: com.apple.frontboard.workspace-service>
    default	22:31:55.923604-0700	IOSFullScreen	FBSWorkspace registering source: <FBSWorkspaceScenesClient: 0x283a8edf0>
    default	22:31:55.923690-0700	IOSFullScreen	FBSWorkspace connected to endpoint : <BSServiceConnectionEndpoint: 0x2804b5500; target: com.apple.frontboard.systemappservices; service: com.apple.frontboard.workspace-service>
    default	22:31:55.923767-0700	IOSFullScreen	Sending handshake request attempt #1 to server
    default	22:31:55.923835-0700	IOSFullScreen	Added observer for process assertions expiration warning: <_RBSExpirationWarningClient: 0x2811b8d00>
    default	22:31:55.924040-0700	IOSFullScreen	Creating connection to com.apple.runningboard
    default	22:31:55.925524-0700	IOSFullScreen	Registering for test daemon availability notify post.
    default	22:31:55.926455-0700	IOSFullScreen	notify_get_state check indicated test daemon not ready.
    default	22:31:55.927824-0700	IOSFullScreen	Handshake succeeded
    default	22:31:55.927875-0700	IOSFullScreen	Identity resolved as application<dev.flutter.example.IOSFullScreen>
    default	22:31:55.935106-0700	IOSFullScreen	Metal API Validation Enabled
    error	22:32:01.282133-0700	IOSFullScreen	Errors found! Invalidating cache...
    default	22:32:01.370409-0700	IOSFullScreen	Creating side-channel connection to com.apple.runningboard
    default	22:32:01.376127-0700	IOSFullScreen	Hit the server for a process handle 9901346000001a2 that resolved to: [application<dev.flutter.example.IOSFullScreen>:418]
    default	22:32:01.376235-0700	IOSFullScreen	Caching handle [application<dev.flutter.example.IOSFullScreen>:418], with ipc id 9901346000001a2, and pid 418
    default	22:32:01.376466-0700	IOSFullScreen	App is being debugged, do not track this hang
    default	22:32:01.376552-0700	IOSFullScreen	Hang detected: 0.27s (debugger attached, not reporting)
    error	22:32:01.543006-0700	IOSFullScreen	fopen failed for data file: errno = 2 (No such file or directory)
    error	22:32:01.543098-0700	IOSFullScreen	Errors found! Invalidating cache...
    default	22:32:08.287343-0700	IOSFullScreen	Received configuration update from daemon (initial)
    default	22:35:15.648250-0700	IOSFullScreen	Entering exit handler.
    default	22:35:15.648365-0700	IOSFullScreen	Exiting exit handler.
    default	22:36:14.981898-0700	IOSFullScreen	Cache loaded with 4536 pre-cached in CacheData and 44 items in CacheExtra.
    default	22:36:14.983108-0700	IOSFullScreen	Initializing connection
    default	22:36:14.983216-0700	IOSFullScreen	Removing all cached process handles
    default	22:36:14.998568-0700	IOSFullScreen	FBSWorkspace connecting to endpoint : <BSServiceConnectionEndpoint: 0x2808f2400; target: com.apple.frontboard.systemappservices; service: com.apple.frontboard.workspace-service>
    default	22:36:15.029218-0700	IOSFullScreen	FBSWorkspace registering source: <FBSWorkspaceScenesClient: 0x2836c9ff0>
    default	22:36:15.029575-0700	IOSFullScreen	FBSWorkspace connected to endpoint : <BSServiceConnectionEndpoint: 0x2808f2400; target: com.apple.frontboard.systemappservices; service: com.apple.frontboard.workspace-service>
    default	22:36:15.031208-0700	IOSFullScreen	Sending handshake request attempt #1 to server
    default	22:36:15.031601-0700	IOSFullScreen	Creating connection to com.apple.runningboard
    default	22:36:15.052005-0700	IOSFullScreen	Added observer for process assertions expiration warning: <_RBSExpirationWarningClient: 0x281dfa0c0>
    default	22:36:15.055349-0700	IOSFullScreen	Registering for test daemon availability notify post.
    default	22:36:15.055427-0700	IOSFullScreen	notify_get_state check indicated test daemon not ready.
    default	22:36:15.055574-0700	IOSFullScreen	Handshake succeeded
    default	22:36:15.055645-0700	IOSFullScreen	Identity resolved as application<dev.flutter.example.IOSFullScreen>
    default	22:36:15.077328-0700	IOSFullScreen	Metal API Validation Enabled
    default	22:36:15.446491-0700	IOSFullScreen	flutter: Observatory listening on http://127.0.0.1:51396/hoDZn7BUqSs=/
    default	22:36:15.812340-0700	IOSFullScreen	[VERBOSE-2:FlutterObservatoryPublisher.mm(115)] Failed to register observatory port with mDNS.
    default	22:37:15.189527-0700	IOSFullScreen	Received configuration update from daemon (initial)
    

    from the device, then from the host

    [  +34 ms] Checking for advertised Dart observatories...
    [+5018 ms] No pointer records found.
    [   +1 ms] mDNS query failed. Checking for an interface with a ipv4 link local address.
    [   +1 ms] Found interface "en0":
    [        ] 	Bound address: "10.0.0.40"
    [        ] Found interface "en2":
    [        ] 	Bound address: "10.0.0.253"
    [        ] Found interface "bridge0":
    [        ] 	Bound address: "192.168.2.1"
    [        ] Found interface "en9":
    [        ] 	Bound address: "169.254.50.146" link local
    [        ] Found interface "en10":
    [        ] 	Bound address: "169.254.100.163" link local
    [        ] An interface with an ipv4 link local address was found.
    [   +2 ms] Waiting for a connection from Flutter on iPhone...
    

    Don't know if it's related to #60634. I don't recall seeing a broadcast prompt.

  9. gaaclarke commented on Aug 26, 2020

    @gaaclarke
  10. xster commented on Aug 27, 2020

    @xster
    MemberAuthor

    Ummm I wonder what we're doing different. I'm connecting via USB, wifi's also on the same network as the host. I'll try again later tonight on xcode/ios beta 6

  11. 59 remaining items

  12. assigned and unassigned on Sep 21, 2020
  13. xster commented on Sep 21, 2020

    @xster
    MemberAuthor

    assigning to @jmagman for doc change on https://flutter.dev/docs/development/add-to-app/ios/project-setup. Prioritization is right since we're already calling it out in https://flutter.dev/docs/development/ios-14.

  14. chinmaygarde commented on Sep 21, 2020

    @chinmaygarde
    Contributor

    Thanks. I assigned the September milestone speculatively too. Please tweak if this is too aggressive.

  15. lslv1243 commented on Sep 25, 2020

    @lslv1243

    This problem has started affecting me today. I could not make it work by adding the script as stated in #63893 (comment) but adding the permission to the Info.plist made it work. I think now I have to pay attention to not commiting this change.

  16. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    engineflutter/engine related. See also e: labels.
    on Sep 28, 2020
  17. jmagman commented on Sep 28, 2020

    @jmagman
    Member

    @lslv1243 The new website documentation hasn't been merged yet, but you can see instructions and sample app at flutter/samples#554 for how to add the right keys to your Debug Info.plist.

    Edit: the website documentation is at https://flutter.dev/docs/development/add-to-app/ios/project-setup#local-network-privacy-permissions.

  18. MikePendo commented on May 31, 2021

    @MikePendo

    Hi
    Any chance you could explain why and how flutter needs those permissions and why it needs the Bonjour services.(maybe a link to read about it)
    (I believe you probably need the Dart VM to run on top of that)

  19. jmagman commented on Jun 1, 2021

    @jmagman
    Member

    @MikePendo The Flutter module broadcasts the port the observatory chose so you can flutter attach from your host machine to hot reload, etc. There's some reference to what you could use it for in https://flutter.dev/docs/development/add-to-app/debugging#debugging.

    You shouldn't add NSBonjourServices to the Release version of your app.

  20. github-actions commented on Aug 1, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  21. locked as resolved and limited conversation to collaborators on Aug 1, 2021
  22. added
    P0Critical issues such as a build break or regression
    and removed on Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressiona: existing-appsIntegration with existing apps via the add-to-app flowc: regressionIt was better in the past than it is nowcustomer: productplatform-iosiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions