-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Build script does not create module for the arm64 simulator #6968
Comments
A fat framework cannot contain both arm64-for-simulator and arm64-for-device slices because the file format only distinguishes on architecture and not the platform, so they're both just "arm64". Instead you have to use a xcframework, which can be built with |
Thanks for your quick response. I've compiled the new Realm version 10.2.0 with
Is there anything else I need to configure or is the arm64 simulator slice still missing in the new release? |
If there is anything you want me to try, please let me know. I'm happy to help. |
I think I've found the cause of this issue. The latest Realm version still defines I've removed this value and rebuilt with |
I've found another minor issue with the build script: It does not accept more than three input parameters: This prevents calls like |
The latest Realm version 10.4.0 has fixed the |
Goals
I want to build Realm as a precompiled framework, embed it into an iOS app and run it in the simulator.
Important: I'm using a M1 MacBook Air and therefore need to compile code for the arm64 simulator.
Expected Results
Xcode compiles the app with Realm as an embedded binary.
Actual Results
Xcode compilation fails with the following error message:
Module 'RealmSwift' was created for incompatible target arm64-apple-ios9.0: /Users/<user>/Developer/realm-cocoa/build/ios/swift-12.2/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm64.swiftmodule
Steps for others to Reproduce
You need an Apple Silicon Mac to reproduce this issue.
./build.sh ios-swift
Realm
andRealmSwift
as an embedded binary and to the framework search pathsimport RealmSwift
to yourViewController.swift
Version of Realm and Tooling
Realm framework version: 10.1.4
Xcode version: 12.2
iOS/OSX version: 14.2
Notes
RealmSwift.framework
from CocoaPods containsswiftdoc
andswiftmodule
files forarm64
andarm64-apple-ios-simulator
. The precompiled framework contains module files forarm
,arm64
andarm64-apple-ios
but is missing the arm64 simulator.arm64
as an excluded architecture for the iOS simulator. I've tried to remove this setting, but that causes the Realm build script to fail with the following error message:fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: build/DerivedData/Realm/Build/Products/Release-iphonesimulator/Realm.framework/Realm and build/DerivedData/Realm/Build/Products/Release-iphoneos/Realm.framework/Realm have the same architectures (arm64) and can't be in the same fat output file
error: The linked and embedded framework 'RealmSwift.framework' is missing one or more architectures required by this target: arm64.
I assume this issue in already covered in Miss one or more architectures required by this target: arm64, x86_64. #6957
Related Issues
The text was updated successfully, but these errors were encountered: