Skip to content

Conversation

@simolus3
Copy link
Contributor

To implement code assets, Flutter tooling converts .dylib files emitted by hooks into Apple frameworks. The format of frameworks is slightly different between macOS and other Apple platforms, and this comment explains the correct format for macOS:

// MyFramework.framework/ frameworkDir
// MyFramework -> Versions/Current/MyFramework dylibLink
// Resources -> Versions/Current/Resources resourcesLink
// Versions/ versionsDir
// A/ versionADir
// MyFramework dylibFile
// Resources/ resourcesDir
// Info.plist
// Current -> A currentLink

Currently, the link from Resources to Versions/Current/Resources is incorrectly generated to Versions/A/Resources. This fixes that to generate both links to Versions/Current.

Closes #178623.

@simolus3 simolus3 requested a review from a team as a code owner November 17, 2025 05:15
@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.

@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. a: desktop Running on desktop team-ios Owned by iOS platform team labels Nov 17, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes the layout for macOS frameworks for code assets. The change ensures that the Resources symlink within the framework points to Versions/Current/Resources instead of the incorrect Versions/A/Resources. The implementation also includes a small refactoring to reuse a variable for the Versions/Current path, which improves code readability and maintainability. The change is correct and aligns with the expected framework structure for macOS.

Copy link
Contributor

@dcharkes dcharkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @simolus3!

(I guess people only tried to publish to the iOS store before this.)

@vashworth
Copy link
Contributor

vashworth commented Nov 19, 2025

Thank you for the contribution! This PR will need tests before we can merge it.

I think a quick check that the symlink is correct somewhere around here would suffice:

// Multi arch.
expect(buildRunner.buildInvocations, flutterTester ? 1 : 2);
expect(buildRunner.linkInvocations, buildMode == BuildMode.release ? 2 : 0);

Probably something like

expect(
  fileSystem.link('/build/native_assets/macos/bar.framework/Resources').targetSync(),
  'Versions/Current/Resources',
);

@simolus3 simolus3 force-pushed the native-assets-macos-fix branch from 23282c4 to 3d36d91 Compare November 19, 2025 16:49
@simolus3 simolus3 force-pushed the native-assets-macos-fix branch from 3d36d91 to b7d6008 Compare November 19, 2025 16:50
Copy link
Contributor

@vashworth vashworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the changes!

@vashworth vashworth added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 19, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Nov 19, 2025
Merged via the queue into flutter:master with commit 17e65b6 Nov 19, 2025
141 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 19, 2025
@simolus3 simolus3 deleted the native-assets-macos-fix branch November 19, 2025 19:12
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 20, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Nov 20, 2025
flutter/flutter@de4be4f...9f383e0

2025-11-20 engine-flutter-autoroll@skia.org Roll Dart SDK from 331595776540 to 5b21f8a7d5d3 (1 revision) (flutter/flutter#178861)
2025-11-20 engine-flutter-autoroll@skia.org Roll ICU from f27805b7d7d8 to a86a32e67b8d (1 revision) (flutter/flutter#178859)
2025-11-20 engine-flutter-autoroll@skia.org Roll Dart SDK from d6f9477a2d9f to 331595776540 (1 revision) (flutter/flutter#178851)
2025-11-20 engine-flutter-autoroll@skia.org Roll Skia from 5bdda9a41db9 to 6284b4f09e14 (3 revisions) (flutter/flutter#178849)
2025-11-20 engine-flutter-autoroll@skia.org Roll Skia from 24c28206d912 to 5bdda9a41db9 (2 revisions) (flutter/flutter#178845)
2025-11-20 engine-flutter-autoroll@skia.org Roll Dart SDK from 7506c64a5117 to d6f9477a2d9f (1 revision) (flutter/flutter#178844)
2025-11-20 engine-flutter-autoroll@skia.org Roll Skia from fd41f3650729 to 24c28206d912 (2 revisions) (flutter/flutter#178841)
2025-11-20 matt.kosarek@canonical.com Use WidgetsBinding.instance.platformDispatcher in windowing instead of PlatformDispatcher.instance (flutter/flutter#178799)
2025-11-20 30870216+gaaclarke@users.noreply.github.com [Impeller] Adds support for r32float textures (flutter/flutter#178418)
2025-11-20 engine-flutter-autoroll@skia.org Roll Skia from a283da7a6b6c to fd41f3650729 (2 revisions) (flutter/flutter#178838)
2025-11-20 chinmaygarde@google.com [Impeller] Deny-list Adreno 640 and 650 for Vulkan eligibility. (flutter/flutter#178833)
2025-11-19 engine-flutter-autoroll@skia.org Roll Skia from b5dc8c3494ac to a283da7a6b6c (8 revisions) (flutter/flutter#178832)
2025-11-19 engine-flutter-autoroll@skia.org Roll Dart SDK from f7e9bd245fd9 to 7506c64a5117 (3 revisions) (flutter/flutter#178828)
2025-11-19 32538273+ValentinVignal@users.noreply.github.com Allow the `RawAutocomplete` to display the options even when one is selected (flutter/flutter#177705)
2025-11-19 mdebbar@google.com [web] Skip flaky service worker test (flutter/flutter#178820)
2025-11-19 evanwall@buffalo.edu Only call glCheckFrameBufferStatus in the render pass in debug builds (flutter/flutter#178707)
2025-11-19 katelovett@google.com Manual pub roll (flutter/flutter#178687)
2025-11-19 logic@deltaq.org Document that `error` parameter must be initialized (flutter/flutter#177730)
2025-11-19 116356835+AbdeMohlbi@users.noreply.github.com Update `_CircularProgressIndicatorState` to use `transform` directly (flutter/flutter#178569)
2025-11-19 simon@journeyapps.com Fix layout for macOS frameworks for code assets (flutter/flutter#178625)
2025-11-19 engine-flutter-autoroll@skia.org Roll Packages from 34746bb to 8f72e4b (7 revisions) (flutter/flutter#178800)

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 louisehsu@google.com,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
okorohelijah pushed a commit to okorohelijah/flutter that referenced this pull request Nov 21, 2025
To implement code assets, Flutter tooling converts `.dylib` files
emitted by hooks into Apple frameworks. The format of frameworks is
slightly different between macOS and other Apple platforms, and this
comment explains the correct format for macOS:


https://github.com/flutter/flutter/blob/f954fb79dd1570d0d05c033df85b4041fddb151f/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets.dart#L134-L142

Currently, the link from `Resources` to `Versions/Current/Resources` is
incorrectly generated to `Versions/A/Resources`. This fixes that to
generate both links to `Versions/Current`.

Closes flutter#178623.
IvoneDjaja pushed a commit to IvoneDjaja/flutter that referenced this pull request Nov 22, 2025
To implement code assets, Flutter tooling converts `.dylib` files
emitted by hooks into Apple frameworks. The format of frameworks is
slightly different between macOS and other Apple platforms, and this
comment explains the correct format for macOS:


https://github.com/flutter/flutter/blob/f954fb79dd1570d0d05c033df85b4041fddb151f/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets.dart#L134-L142

Currently, the link from `Resources` to `Versions/Current/Resources` is
incorrectly generated to `Versions/A/Resources`. This fixes that to
generate both links to `Versions/Current`.

Closes flutter#178623.
mboetger pushed a commit to mboetger/flutter that referenced this pull request Dec 2, 2025
To implement code assets, Flutter tooling converts `.dylib` files
emitted by hooks into Apple frameworks. The format of frameworks is
slightly different between macOS and other Apple platforms, and this
comment explains the correct format for macOS:


https://github.com/flutter/flutter/blob/f954fb79dd1570d0d05c033df85b4041fddb151f/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets.dart#L134-L142

Currently, the link from `Resources` to `Versions/Current/Resources` is
incorrectly generated to `Versions/A/Resources`. This fixes that to
generate both links to `Versions/Current`.

Closes flutter#178623.
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
To implement code assets, Flutter tooling converts `.dylib` files
emitted by hooks into Apple frameworks. The format of frameworks is
slightly different between macOS and other Apple platforms, and this
comment explains the correct format for macOS:


https://github.com/flutter/flutter/blob/f954fb79dd1570d0d05c033df85b4041fddb151f/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets.dart#L134-L142

Currently, the link from `Resources` to `Versions/Current/Resources` is
incorrectly generated to `Versions/A/Resources`. This fixes that to
generate both links to `Versions/Current`.

Closes flutter#178623.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS: Frameworks for code assets have wrong layout, causing AppStore rejections

3 participants