Repository navigation
Add ARM simulator architecture slice to App.framework to support Apple Silicon #69334
Copy link
Copy link
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowplatform-host-armBuilding on an ARM-based platformBuilding on an ARM-based platformplatform-iosiOS applications specificallyiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
With the upcoming support for Apple Silicon ARM simulators, App.framework (and add-to-app xcframework) needs a simulator ARM slice on ARM macOS. Universal (fat) App.framework can no longer contain architectures for both iphoneos and iphonesimulator since they need to be build against different SDKs, but they can no longer be lipod together (lipo complains both binaries contain arm64 and fails).
Primarily this is a problem when building the debug stub framework:
flutter/packages/flutter_tools/lib/src/build_system/targets/ios.dart
Lines 106 to 111 in cb67513
| 'lipo', | |
| ...darwinArchs.map((DarwinArch iosArch) => | |
| environment.fileSystem.path.join(buildOutputPath, getNameForDarwinArch(iosArch), 'App.framework', 'App')), | |
| '-create', | |
| '-output', | |
| resultPath, |
And in flutter build ios-framework that smush together plugin frameworks.
- Build App.framework directly to build directory #69699 Output App.framework to different
iphoneosandiphonesimulatordirectories - Compile snapshot_assembly with sdk root set in Xcode #69731 Refactor the build system to take either the
iphoneosandiphonesimulatorSDK from Xcode instead of trying to guess from the architectures (to stop assuming x86 == simulator). Use it foraot - Build either iphoneos or iphonesimulator App.framework, not both #69840 Remove
lipoing from debug stub framework step and only use the requestediphoneosoriphonesimulatorSDK, not for both. Refactorflutter build ios-frameworkas needed. - Deprecate build ios-framework --universal #69720 Deprecate
flutter build ios-framework --universal - Add to app prebuilt binaries as xcframeworks website#4956 Update add-to-app website docs to use xcframework
- Use xcframeworks in prebuilt add-to-app sample samples#582 Update add-to-app sample to use xcframework
- Remove --universal flag in "flutter build ios-framework" #69733 Remove
flutter build ios-framework --universal - Deprecate and replace build aot #49562 Deprecate
flutter build aot - Add the ARM architecture slice
Flutter.framework engine work tracked in #64502
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowplatform-host-armBuilding on an ARM-based platformBuilding on an ARM-based platformplatform-iosiOS applications specificallyiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
jmagman commentedon Oct 30, 2020
Not sure this will be possible without also changing this to an xcframework #36204 since the iphoneos and iphonesimulator ARM frameworks can't be lipo'd together.
Edit: Actually it's not being distributed (except for add-to-app) so we can use App.framework, but it needs to be built for the requested target/SDK instead of for all supported archs.
xster commentedon Jan 11, 2021
Moving the milestone to March
entonio commentedon May 4, 2021
What will be the correct command line to build a module that can be integrated using Option A from https://flutter.dev/docs/development/add-to-app/ios/project-setup ?
jmagman commentedon May 5, 2021
@entonio What do you mean, are you seeing a problem related to option A and the ARM simulator?
Don't forget to update
EXCLUDED_ARCHSin your host app https://flutter.dev/docs/development/add-to-app/ios/project-setup#apple-silicon-arm64-macsgithub-actions commentedon Jul 30, 2021
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 -vand a minimal reproduction of the issue.