Reputation: 2599
Getting this error.
Realm/core/librealmcore-ios.a(array_binary.o), building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
Swift iOS 14 xcode 12.0.1
What I have tried :
Nothing seems to work Seems realm are having issues too : https://realm.io/docs/swift/latest/#cocoapods
"Arm64 simulator architecture may not be supported for several combinations of Realm 5.x and Xcode 12. Please attempt the following workarounds if you experience architecture-related build errors with the latest version of Realm."
Upvotes: 7
Views: 15862
Reputation: 2599
What I did was
setting the BuildActiveArchitectureOnly to Yes in the build settings.
And
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
end
end
And
Updated my Realm to the latest version.
Upvotes: 2
Reputation: 6824
Use
pod 'RealmSwift', '~> 10.5.0'
They already added support for xcframework.
Upvotes: 7
Reputation: 861
It's not really a proper fix, but what worked for my project is:
BuildActiveArchitectureOnly
to Yes
in the cocoapods projectNow when you build your app for your device or you're archiving make sure to set this back to No
, or alternatively, use a different config for this (e.g: I have Debug
set to Yes
, Release
to No
).
Upvotes: 2