Skip to content

Document that debug Flutter apps cannot be manually launched on the device on iOS 14 #62531

Closed

Description

@jmagman

On iOS 14 execution of JIT fails when the debugger is not attached, and debug Flutter apps (including host add-to-app applications) crash on launch when manually launched from the home screen on a physical device.

Reproduction steps

$ flutter create test_crash
$ cd test_crash
$ flutter run --debug -d physical-device-ios-14-identifier
<q> (quit)

On the device’s home screen, launch the newly installed Flutter app.

Write up documentation that the engine/tool can link and can be published as an "annoyance" describing this new limitation.

Activity

  1. jmagman commented on Jul 29, 2020

    @jmagman
    MemberAuthor

    Issue tracking some UI in the engine to display and link to this documentation, instead of crashing:
    #62518

  2. jmagman commented on Jul 29, 2020

    @jmagman
    MemberAuthor

    @sfshaza2 Do you think this belongs on the website?

  3. jmagman commented on Jul 29, 2020

    @jmagman
    MemberAuthor
  4. filiph commented on Jul 30, 2020

    @filiph
    Contributor

    Trying to understand better, please let me know if I'm wrong about any of this:

    • This only happens on iOS 14 and there's no (or very low) chance it will manifest in iOS 13, for example.
    • This must be fixed on our side. It's not an example of some regression bug in iOS 14.
    • iOS is not yet available for consumer use, and is expected to be in Fall (i.e. months from now).
    • But all iOS developers have access to iOS 14 for testing / dev purposes.
    • And iOS 14 is at the stage when developers are encouraged by Apple to start developing for iOS 14 and having it installed on their dev devices.

    Again, I'm not sure about any of the above, and would welcome any correction.

    FWIW, I think we should tweet about this sooner rather than later, assuming all of my assumptions are true.

  5. jmagman commented on Jul 30, 2020

    @jmagman
    MemberAuthor

    A little more context:
    This crash is only relevant for physical iOS 14 devices and debug versions of the Flutter app. iOS 13 and below, simulators, and release versions of the app (so what end-customers will see) is unaffected.

    The following does not work targeting an iOS 14 device:

    • On the device, launching the app by tapping an installed Flutter debug app on the home screen or a Siri search result
    • flutter install then launching the debug app manually from the home screen
    • Archiving and deploying a debug version of the app for testing (distribution to QA, etc), installing, and launching manually from the home screen

    The following does work on iOS 14:

    • Launching the app from the Flutter command line with flutter run --debug or an IDE like Android Studio
    • Running the app from Xcode on the host Mac (ios/Runner.xcworkspace or an add-to-app host app)
    • Launching from the home screen on a simulator manually from the home screen
    • Launching release version of the app manually from the home screen
    • This only happens on iOS 14 and there's no (or very low) chance it will manifest in iOS 13, for example.

    Yes, iOS 14 only.

    • This must be fixed on our side. It's not an example of some regression bug in iOS 14.

    Apple changed some kernel behavior that disallowed an API dart is relying on, and we assume it was a purposeful change on their side.

    • iOS is not yet available for consumer use, and is expected to be in Fall (i.e. months from now).
    • But all iOS developers have access to iOS 14 for testing / dev purposes.
    • And iOS 14 is at the stage when developers are encouraged by Apple to start developing for iOS 14 and having it installed on their dev devices.

    Yes, yes, and yes.

    FWIW, I think we should tweet about this sooner rather than later, assuming all of my assumptions are true.

    I'd like to hold off a bit until we decide how it will manifest to the user. We may be able to work around this issue completely (probably unlikely), and if not will likely show UI in the app that explains why what they tried won't work, and a link to documentation (tracked by this issue). \cc @zanderso

  6. filiph commented on Jul 30, 2020

    @filiph
    Contributor

    Thanks, that's very helpful!

    For what it's worth, while I think it's good to see if we can work around this quickly, we should not wait too long. Assuming this is happening to developers out there right now, and given the potentially frustrating aspect of "crashed while I was demoing my work to someone", I'd rather be proactive. I say let's make a decision by end of Thursday.

  7. jmagman commented on Jul 30, 2020

    @jmagman
    MemberAuthor

    @filiph Responding quickly makes sense. We likely won't have anything working by Thursday, I definitely defer to whenever you and @zanderso think is best to get the word out. We don't plan to ship the next stable with this crash-on-launch behavior, I just don't want them to think that will be Flutter's expected behavior moving forward.

  8. filiph commented on Jul 30, 2020

    @filiph
    Contributor

    Oh, additional question:

  9. jmagman commented on Jul 30, 2020

    @jmagman
    MemberAuthor

    Yes, all channels are impacted, including current stable.

  10. jmagman commented on Jul 31, 2020

    @jmagman
    MemberAuthor

    Summary of this issue, and other iOS 14 annoyances:

    Debug crash on launch
    Flutter debug applications crash when manually launched from the home screen on a physical iOS 14 device. Add-to-app debug applications will crash when the Flutter module loads.
    This will not impact release versions of the application, and is not visible to end-users.

    Workarounds:

    • Launch the app from the Flutter command line with flutter run or an IDE like Android Studio.
    • Run the app from Xcode on the host Mac (ios/Runner.xcworkspace or an add-to-app host app).
    • Run the profile or release version of the app.
    • Run on an iOS 14 simulator.

    GitHub issue: #60657

    Local network notification
    The dart observatory in Flutter debug applications prompts a permission notification that your app "would like to find and connect to devices on your local network". To use hot reload, make sure to select "OK" instead of "Don't Allow".
    This will not impact release versions of the application, and is not visible to end-users.

    GitHub issue: #60634

    Clipboard notifications
    Flutter apps will show notifications that the app is pasting from your clipboard when no paste was initiated. This will impact released apps, and end-users will see this when running the app on iOS 14. A fix for this behavior will soon be available on the master channel.

    GitHub issue: #60145

  11. sfshaza2 commented on Aug 5, 2020

    @sfshaza2
    Contributor

    I've handled this in PR flutter/website#4435. I've incorporated Jenn's feedback, but need approval.

  12. sfshaza2 commented on Aug 6, 2020

    @sfshaza2
    Contributor

    Merged.

  13. pedromassangocode commented on Aug 7, 2020

    @pedromassangocode

    Merged.

    Is this still a valid issue?

  14. jmagman commented on Aug 7, 2020

    @jmagman
    MemberAuthor

    I think @xster wanted more add-to-app documentation. flutter/website#4435 is a good start though!

  15. xster commented on Sep 17, 2020

    @xster
    Member
  16. kherldhussein commented on Sep 18, 2020

    @kherldhussein

    Closed

  17. PerrchicK commented on Dec 31, 2020

    @PerrchicK

    Question, is everyone OK with this new behaviour? 😯

  18. github-actions commented on Aug 7, 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.

  19. locked as resolved and limited conversation to collaborators on Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions