Seems that after updating Xcode 12 to beta 5, SwiftUI previews are not working anymore when using Firebase/Analytics pod. Previews are failing with error:
linker command failed with exit code 1 (use -v to see invocation)
----------------------------------------
SchemeBuildError: Failed to build the scheme "Boo"
linker command failed with exit code 1 (use -v to see invocation)
Link Boo (arm64):
ld: in /Users/../Boo/Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector(FIRAnalyticsConnector_e321ed8e3db06efc9803f6c008e67a34.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/.../Boo/Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any suggestions how to fix this?
To exclude the arm64 architecture only when running on a simulator, add the "Any iOS Simulator SDK" qualifier in the build settings. Then you won't have to remove this setting when testing on a physical device.
To add the qualifier, click on the little plus button, as shown.
The following workaround (credit to user on Apple Developer forums) worked for me:
Add "arm64" to the excluded architectures for the debug scheme for any targets that have Firebase Analytics.
This will cause you problems if you need to debug to an actual iOS device, obviously. But you can remove it when you need to test on a device.
The accepted answer also worked for me. But I didn't know how to do this as I have never done it before so I wanted to show you the steps I took to accomplish this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With