Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XCFramework Support #38

Closed
empowerMax opened this issue Nov 1, 2021 · 2 comments
Closed

XCFramework Support #38

empowerMax opened this issue Nov 1, 2021 · 2 comments

Comments

@empowerMax
Copy link

Hi 👋 , it'd be awesome if y'all could distribute an XCFramework as part of your releases.

Since the addition of arm simulators on the m1 Macs we've had build issues integrating the AdaEmbedFramework.
For instance:

Module 'AdaEmbedFramework' was created for incompatible target arm64-apple-ios10.0-simulator: //app/Frameworks/AdaEmbedFramework.framework/Modules/AdaEmbedFramework.swiftmodule/arm64.swiftmodule

We work around this by building the Ada framework from source ourselves and stripping the arm64 flavour from frameworks for Simulator builds (by setting EXCLUDED_ARCHS). Given you're already supplying a fat framework as part of your releases, perhaps it won't be too much effort to supply an XCFramework.

Apple's doc about how to make one: https://help.apple.com/xcode/mac/11.4/#/dev544efab96
Or from the command line:

# Archive for iOS simulator (both intel and arm)
xcodebuild archive \
-scheme AdaEmbedFramework \
-destination "generic/platform=iOS Simulator" \
-archivePath <#output-path#>/ada-sim.xcarchive \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

# Archive for iOS device (arm)
xcodebuild archive \
-scheme AdaEmbedFramework \
-destination "generic/platform=iOS" \
-archivePath  <#output-path#>/ada-device.xcarchive \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

# Glue them together into an XCFramework
xcodebuild -create-xcframework \
-framework <#output-path#>ada-sim.xcarchive/Products/Library/Frameworks/AdaEmbedFramework.framework \
-framework <#output-path#>ada-device.xcarchive/Products/Library/Frameworks/AdaEmbedFramework.framework \
-output ./AdaEmbedFramework.xcframework
@empowerMax
Copy link
Author

Hi @lujcheng any update on this or #26 ?

@michaellazz
Copy link
Contributor

I've just released our first version of this as part of 1.8.0 https://github.com/AdaSupport/ios-sdk/releases/tag/1.8.0 going to close this since now we are including xcframework support :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants