Skip to content

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Jan 6, 2021

Description

Generate an x86 simulator slice for profile and release for add-to-app flutter build ios-framework for plugins, App.framework, and plugin registrant framework. This matches profile and release Flutter.xcframework.

This lets users build in profile/release against the simulator in their host app, (even though it uses a Debug version of Flutter).

Related Issues

Fixes #66474

Blocked by #73383 to avoid #47930

Tests

Updated build_ios_framework_module_test

@flutter-dashboard flutter-dashboard bot added c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Jan 6, 2021
@jmagman jmagman self-assigned this Jan 6, 2021
@google-cla google-cla bot added the cla: yes label Jan 6, 2021
@jmagman jmagman marked this pull request as draft January 6, 2021 00:58
@flutter-dashboard
Copy link

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@jmagman jmagman force-pushed the sim-release-build branch 2 times, most recently from fa6ee8f to 932182e Compare January 6, 2021 19:18
@jmagman jmagman marked this pull request as ready for review January 6, 2021 19:25
Copy link
Member

@xster xster left a comment

Choose a reason for hiding this comment

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

Happy new year!

@jmagman jmagman merged commit 3082a28 into flutter:master Jan 6, 2021
@jmagman jmagman deleted the sim-release-build branch January 6, 2021 20:12
@Cr1xus
Copy link

Cr1xus commented Feb 12, 2021

Hi @jmagman!

I am trying to build flutter app with the following command: flutter build ios-framework --xcframework

And even after this PR there is no simulator slice in App.xcframework, FlutterPluginRegistrant.xcframework in release/profile folders. How can I build it so that I can run it on simulator and device in release configuration?

@jmagman
Copy link
Member Author

jmagman commented Feb 16, 2021

@Cr1xus I just tried is and I see:

Profile/App.xcframework/ios-x86_64-simulator
Profile/FlutterPluginRegistrant.xcframework/ios-x86_64-simulator

etc.

What version of Flutter are you on? #73378 is available in 1.26.0-12.0.pre which is currently the dev and beta channels.

@Cr1xus
Copy link

Cr1xus commented Feb 16, 2021

@jmagman I am on latest stable (1.22.6). My bad, it is not on master channel. Thank you for checking.
When do you plan to release it?

At the moment I did a workaround by copying Debug(x86_64) architecture into Release .xcframework, but would be good to use it properly.

@jmagman
Copy link
Member Author

jmagman commented Feb 16, 2021

@jmagman I am on latest stable (1.22.6). My bad, it is not on master channel. Thank you for checking.
When do you plan to release it?

We release stable about once a quarter, stay tuned!

At the moment I did a workaround by copying Debug(x86_64) architecture into Release .xcframework, but would be good to use it properly.

If that works, it's a good workaround. I would have thought you would also have needed to add ios-x86_64-simulator to the XCFramework's Info.plist (example Profile/App.xcframework/Info.plist) AvailableLibraries array, but if it works without it, that's great.
Info.plist.txt

<array>
	<dict>
		<key>LibraryIdentifier</key>
		<string>ios-arm64_armv7</string>
		<key>LibraryPath</key>
		<string>App.framework</string>
		<key>SupportedArchitectures</key>
		<array>
			<string>arm64</string>
			<string>armv7</string>
		</array>
		<key>SupportedPlatform</key>
		<string>ios</string>
	</dict>
	<dict>
		<key>LibraryIdentifier</key>
		<string>ios-x86_64-simulator</string>
		<key>LibraryPath</key>
		<string>App.framework</string>
		<key>SupportedArchitectures</key>
		<array>
			<string>x86_64</string>
		</array>
		<key>SupportedPlatform</key>
		<string>ios</string>
		<key>SupportedPlatformVariant</key>
		<string>simulator</string>
	</dict>
</array>

@Cr1xus
Copy link

Cr1xus commented Feb 16, 2021

If that works, it's a good workaround. I would have thought you would also have needed to add ios-x86_64-simulator to the XCFramework's Info.plist (example Profile/App.xcframework/Info.plist) AvailableLibraries array, but if it works without it, that's great.

Yep, did that as well. Actually, wrote a script to do that. Copies x86_64 & substitutes Info.plist into Release .xcframework.

We release stable about once a quarter, stay tuned!

Got it, will be waiting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x86_64 builds in missing for release configuration in xcframeworks
3 participants