Skip to content

Conversation

@p1318k
Copy link
Contributor

@p1318k p1318k commented Jul 17, 2025

Overview
This PR fixes a crash that occurs when launching Flutter desktop applications on macOS Mojave (10.14).

Changes Made
• Added conditional checks to ensure the code using the hasUnifiedMemory API only runs on macOS 10.15 or later, since hasUnifiedMemory is only supported starting from macOS 10.15.
• Ensured that the fix maintains compatibility with newer macOS versions without affecting existing functionality.

Testing
• Verified that Flutter desktop apps launch and run normally on both macOS Mojave and later macOS versions.
• Confirmed no side effects by running default Flutter desktop sample apps.

Additional Notes
https://developer.apple.com/documentation/metal/mtldevice/hasunifiedmemory

This PR aims to improve the stability of Flutter desktop applications on macOS Mojave.
Thank you for your review and consideration.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@google-cla
Copy link

google-cla bot commented Jul 17, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added engine flutter/engine related. See also e: labels. a: desktop Running on desktop platform-macos labels Jul 17, 2025
@p1318k p1318k force-pushed the fix_macos_mojave_crash branch from b221e31 to d8bffb9 Compare July 18, 2025 10:03
@p1318k
Copy link
Contributor Author

p1318k commented Jul 18, 2025

The issue is also occurring in the Flutter SDK stable version (v3.32.7).
I hope it will be released to the stable channel as soon as possible.

@p1318k p1318k force-pushed the fix_macos_mojave_crash branch from d8bffb9 to 3364a5d Compare July 18, 2025 13:06
@p1318k p1318k changed the title Fix macOS Mojave Crash on Flutter Desktop Startup fix: macOS Mojave Crash on Flutter Desktop Startup Jul 18, 2025
@p1318k
Copy link
Contributor Author

p1318k commented Jul 21, 2025

@loic-sharma could you please follow up on this issue? We are preparing for a new app release on 07/30 and are waiting for the fix to be included in the Flutter stable channel before then.

@chinmaygarde chinmaygarde added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 21, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Jul 21, 2025
Merged via the queue into flutter:master with commit b2a6cdb Jul 21, 2025
175 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 21, 2025
@p1318k p1318k deleted the fix_macos_mojave_crash branch July 21, 2025 23:57
@p1318k
Copy link
Contributor Author

p1318k commented Jul 22, 2025

@chinmaygarde , @jason-simmons,

Would it be possible to cherry-pick this PR into the stable branch? We’re planning a new app release on July 30 and would like to ensure that this fix is included in the Flutter stable channel before then.

Thank you!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 22, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 22, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 22, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 22, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 22, 2025
flutter/flutter@70cdc0c...ee0cc66

2025-07-22 30870216+gaaclarke@users.noreply.github.com Licenses cpp ignore whitespace (flutter/flutter#172512)
2025-07-22 codefu@google.com feat: start using the content aware hash for downloading artifacts (flutter/flutter#172552)
2025-07-22 hirofumi0081@gmail.com fix: correct typo in analysis_options.yaml comment (disabeling -> disabling) (flutter/flutter#170206)
2025-07-22 matanlurey@users.noreply.github.com Hide `flutter assemble` unless `--verbose` (flutter/flutter#172508)
2025-07-22 huy@nevercode.io Fix PopupMenuButton crashes when being hidden immediately (flutter/flutter#171970)
2025-07-22 victorsanniay@gmail.com Add hitTestChildren to baseline-aligned stack (flutter/flutter#172485)
2025-07-22 engine-flutter-autoroll@skia.org Roll Skia from 4aba494b8108 to eea1c33fbe84 (11 revisions) (flutter/flutter#172515)
2025-07-22 30870216+gaaclarke@users.noreply.github.com Replaces legacy licenses check with licenses_cpp (flutter/flutter#172486)
2025-07-22 matanlurey@users.noreply.github.com Omit `w` (widget tree), `t` (render tree) from `flutter run --profile` `h` (flutter/flutter#172506)
2025-07-22 matanlurey@users.noreply.github.com Refactor checks for `--machine` (flutter/flutter#172504)
2025-07-22 ricardodalarme@outlook.com feat(IconButton): add property to specify a states controller (flutter/flutter#169821)
2025-07-21 98614782+auto-submit[bot]@users.noreply.github.com Reverts "feat: start using the content aware hash for downloading artifacts (#171927)" (flutter/flutter#172505)
2025-07-21 robert.ancell@canonical.com Render Flutter in its own EGL context (flutter/flutter#172330)
2025-07-21 34465683+rkishan516@users.noreply.github.com Feat: Add momentary varient of CupertinoSlidingSegmentedControl (flutter/flutter#164262)
2025-07-21 engine-flutter-autoroll@skia.org Roll Packages from cb8fef6 to 9c85e5e (10 revisions) (flutter/flutter#172479)
2025-07-21 matanlurey@users.noreply.github.com Wrap `ShutdownHook` calls to avoid crashing the tool (flutter/flutter#171917)
2025-07-21 p1318k@gmail.com fix: macOS Mojave Crash on Flutter Desktop Startup (flutter/flutter#172282)
2025-07-21 engine-flutter-autoroll@skia.org Roll Skia from 9587301e33bc to 4aba494b8108 (41 revisions) (flutter/flutter#172471)
2025-07-21 stuartmorgan@google.com Add CLA note to tree hygiene (flutter/flutter#172475)
2025-07-21 32538273+ValentinVignal@users.noreply.github.com Add `radioInnerRadius` to `RadioListTile` (flutter/flutter#171851)
2025-07-21 58529443+srujzs@users.noreply.github.com Use baseUri always when doing a hot reload or hot restart (flutter/flutter#172271)
2025-07-21 codefu@google.com feat: start using the content aware hash for downloading artifacts (flutter/flutter#171927)
2025-07-21 matanlurey@users.noreply.github.com Add support for `/?` to alias to `--help` (flutter/flutter#172328)
2025-07-21 jason-simmons@users.noreply.github.com Upgrade flutter_lints in project template pubspec.yaml files (flutter/flutter#172400)
2025-07-21 matanlurey@users.noreply.github.com Use `$dartSdkVersion` when creating "dummy" pubspec for `create_api_docs` (flutter/flutter#172327)
2025-07-21 matanlurey@users.noreply.github.com Adds `(defaults to ___)` when using `flutter config --help` (flutter/flutter#172329)
2025-07-21 matanlurey@users.noreply.github.com Add a warning on usage of `dartPluginClass: 'none'`. (flutter/flutter#172315)
2025-07-21 matanlurey@users.noreply.github.com Skip [tool] crash reporting on `--local-engine` (flutter/flutter#172326)
2025-07-21 matanlurey@users.noreply.github.com Remove IDE validation from `flutter doctor` (flutter/flutter#171924)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@jason-simmons jason-simmons added the cp: stable cherry pick this pull request to stable release candidate branch label Jul 23, 2025
flutteractionsbot pushed a commit to flutteractionsbot/flutter that referenced this pull request Jul 23, 2025
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

Overview
This PR fixes a crash that occurs when launching Flutter desktop
applications on macOS Mojave (10.14).

Changes Made
• Added conditional checks to ensure the code using the
`hasUnifiedMemory` API only runs on macOS 10.15 or later, since
`hasUnifiedMemory` is only supported starting from macOS 10.15.
• Ensured that the fix maintains compatibility with newer macOS versions
without affecting existing functionality.

Testing
• Verified that Flutter desktop apps launch and run normally on both
macOS Mojave and later macOS versions.
• Confirmed no side effects by running default Flutter desktop sample
apps.

Additional Notes
•
https://developer.apple.com/documentation/metal/mtldevice/hasunifiedmemory

This PR aims to improve the stability of Flutter desktop applications on
macOS Mojave.
Thank you for your review and consideration.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Co-authored-by: Kim Ki Cheol <kim.kicheol@sk.com>
auto-submit bot pushed a commit that referenced this pull request Jul 23, 2025
### Issue Link:

#172282 (comment)

### Changelog Description:

Do not call an API that was introduced in macOS 10.15 on versions before 10.15.

### Impact Description:

Apps will crash on macOS 10.14 (which is a supported platform according to https://docs.flutter.dev/reference/supported-platforms)

### Workaround:
Is there a workaround for this issue?

No

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

(Tests that run on current versions of macOS will confirm that this PR does not cause regressions.  But I don't know if we have any tests that run on macOS 10.14)

### Validation Steps:
What are the steps to validate that this fix works?

Run a Flutter app on macOS Mojave (10.14)
azatech pushed a commit to azatech/flutter that referenced this pull request Jul 28, 2025
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

Overview
This PR fixes a crash that occurs when launching Flutter desktop
applications on macOS Mojave (10.14).

Changes Made
• Added conditional checks to ensure the code using the
`hasUnifiedMemory` API only runs on macOS 10.15 or later, since
`hasUnifiedMemory` is only supported starting from macOS 10.15.
• Ensured that the fix maintains compatibility with newer macOS versions
without affecting existing functionality.

Testing
• Verified that Flutter desktop apps launch and run normally on both
macOS Mojave and later macOS versions.
• Confirmed no side effects by running default Flutter desktop sample
apps.

Additional Notes
•
https://developer.apple.com/documentation/metal/mtldevice/hasunifiedmemory

This PR aims to improve the stability of Flutter desktop applications on
macOS Mojave.
Thank you for your review and consideration.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Co-authored-by: Kim Ki Cheol <kim.kicheol@sk.com>
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
flutter/flutter@70cdc0c...ee0cc66

2025-07-22 30870216+gaaclarke@users.noreply.github.com Licenses cpp ignore whitespace (flutter/flutter#172512)
2025-07-22 codefu@google.com feat: start using the content aware hash for downloading artifacts (flutter/flutter#172552)
2025-07-22 hirofumi0081@gmail.com fix: correct typo in analysis_options.yaml comment (disabeling -> disabling) (flutter/flutter#170206)
2025-07-22 matanlurey@users.noreply.github.com Hide `flutter assemble` unless `--verbose` (flutter/flutter#172508)
2025-07-22 huy@nevercode.io Fix PopupMenuButton crashes when being hidden immediately (flutter/flutter#171970)
2025-07-22 victorsanniay@gmail.com Add hitTestChildren to baseline-aligned stack (flutter/flutter#172485)
2025-07-22 engine-flutter-autoroll@skia.org Roll Skia from 4aba494b8108 to eea1c33fbe84 (11 revisions) (flutter/flutter#172515)
2025-07-22 30870216+gaaclarke@users.noreply.github.com Replaces legacy licenses check with licenses_cpp (flutter/flutter#172486)
2025-07-22 matanlurey@users.noreply.github.com Omit `w` (widget tree), `t` (render tree) from `flutter run --profile` `h` (flutter/flutter#172506)
2025-07-22 matanlurey@users.noreply.github.com Refactor checks for `--machine` (flutter/flutter#172504)
2025-07-22 ricardodalarme@outlook.com feat(IconButton): add property to specify a states controller (flutter/flutter#169821)
2025-07-21 98614782+auto-submit[bot]@users.noreply.github.com Reverts "feat: start using the content aware hash for downloading artifacts (#171927)" (flutter/flutter#172505)
2025-07-21 robert.ancell@canonical.com Render Flutter in its own EGL context (flutter/flutter#172330)
2025-07-21 34465683+rkishan516@users.noreply.github.com Feat: Add momentary varient of CupertinoSlidingSegmentedControl (flutter/flutter#164262)
2025-07-21 engine-flutter-autoroll@skia.org Roll Packages from cb8fef6 to 9c85e5e (10 revisions) (flutter/flutter#172479)
2025-07-21 matanlurey@users.noreply.github.com Wrap `ShutdownHook` calls to avoid crashing the tool (flutter/flutter#171917)
2025-07-21 p1318k@gmail.com fix: macOS Mojave Crash on Flutter Desktop Startup (flutter/flutter#172282)
2025-07-21 engine-flutter-autoroll@skia.org Roll Skia from 9587301e33bc to 4aba494b8108 (41 revisions) (flutter/flutter#172471)
2025-07-21 stuartmorgan@google.com Add CLA note to tree hygiene (flutter/flutter#172475)
2025-07-21 32538273+ValentinVignal@users.noreply.github.com Add `radioInnerRadius` to `RadioListTile` (flutter/flutter#171851)
2025-07-21 58529443+srujzs@users.noreply.github.com Use baseUri always when doing a hot reload or hot restart (flutter/flutter#172271)
2025-07-21 codefu@google.com feat: start using the content aware hash for downloading artifacts (flutter/flutter#171927)
2025-07-21 matanlurey@users.noreply.github.com Add support for `/?` to alias to `--help` (flutter/flutter#172328)
2025-07-21 jason-simmons@users.noreply.github.com Upgrade flutter_lints in project template pubspec.yaml files (flutter/flutter#172400)
2025-07-21 matanlurey@users.noreply.github.com Use `$dartSdkVersion` when creating "dummy" pubspec for `create_api_docs` (flutter/flutter#172327)
2025-07-21 matanlurey@users.noreply.github.com Adds `(defaults to ___)` when using `flutter config --help` (flutter/flutter#172329)
2025-07-21 matanlurey@users.noreply.github.com Add a warning on usage of `dartPluginClass: 'none'`. (flutter/flutter#172315)
2025-07-21 matanlurey@users.noreply.github.com Skip [tool] crash reporting on `--local-engine` (flutter/flutter#172326)
2025-07-21 matanlurey@users.noreply.github.com Remove IDE validation from `flutter doctor` (flutter/flutter#171924)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

Overview
This PR fixes a crash that occurs when launching Flutter desktop
applications on macOS Mojave (10.14).

Changes Made
• Added conditional checks to ensure the code using the
`hasUnifiedMemory` API only runs on macOS 10.15 or later, since
`hasUnifiedMemory` is only supported starting from macOS 10.15.
• Ensured that the fix maintains compatibility with newer macOS versions
without affecting existing functionality.

Testing
• Verified that Flutter desktop apps launch and run normally on both
macOS Mojave and later macOS versions.
• Confirmed no side effects by running default Flutter desktop sample
apps.

Additional Notes
•
https://developer.apple.com/documentation/metal/mtldevice/hasunifiedmemory

This PR aims to improve the stability of Flutter desktop applications on
macOS Mojave.
Thank you for your review and consideration.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Co-authored-by: Kim Ki Cheol <kim.kicheol@sk.com>
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

Overview
This PR fixes a crash that occurs when launching Flutter desktop
applications on macOS Mojave (10.14).

Changes Made
• Added conditional checks to ensure the code using the
`hasUnifiedMemory` API only runs on macOS 10.15 or later, since
`hasUnifiedMemory` is only supported starting from macOS 10.15.
• Ensured that the fix maintains compatibility with newer macOS versions
without affecting existing functionality.

Testing
• Verified that Flutter desktop apps launch and run normally on both
macOS Mojave and later macOS versions.
• Confirmed no side effects by running default Flutter desktop sample
apps.

Additional Notes
•
https://developer.apple.com/documentation/metal/mtldevice/hasunifiedmemory

This PR aims to improve the stability of Flutter desktop applications on
macOS Mojave.
Thank you for your review and consideration.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Co-authored-by: Kim Ki Cheol <kim.kicheol@sk.com>
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

Overview
This PR fixes a crash that occurs when launching Flutter desktop
applications on macOS Mojave (10.14).

Changes Made
• Added conditional checks to ensure the code using the
`hasUnifiedMemory` API only runs on macOS 10.15 or later, since
`hasUnifiedMemory` is only supported starting from macOS 10.15.
• Ensured that the fix maintains compatibility with newer macOS versions
without affecting existing functionality.

Testing
• Verified that Flutter desktop apps launch and run normally on both
macOS Mojave and later macOS versions.
• Confirmed no side effects by running default Flutter desktop sample
apps.

Additional Notes
•
https://developer.apple.com/documentation/metal/mtldevice/hasunifiedmemory

This PR aims to improve the stability of Flutter desktop applications on
macOS Mojave.
Thank you for your review and consideration.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Co-authored-by: Kim Ki Cheol <kim.kicheol@sk.com>
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

Overview
This PR fixes a crash that occurs when launching Flutter desktop
applications on macOS Mojave (10.14).

Changes Made
• Added conditional checks to ensure the code using the
`hasUnifiedMemory` API only runs on macOS 10.15 or later, since
`hasUnifiedMemory` is only supported starting from macOS 10.15.
• Ensured that the fix maintains compatibility with newer macOS versions
without affecting existing functionality.

Testing
• Verified that Flutter desktop apps launch and run normally on both
macOS Mojave and later macOS versions.
• Confirmed no side effects by running default Flutter desktop sample
apps.

Additional Notes
•
https://developer.apple.com/documentation/metal/mtldevice/hasunifiedmemory

This PR aims to improve the stability of Flutter desktop applications on
macOS Mojave.
Thank you for your review and consideration.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Co-authored-by: Kim Ki Cheol <kim.kicheol@sk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop cp: stable cherry pick this pull request to stable release candidate branch engine flutter/engine related. See also e: labels. platform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants