After upgrading to Xcode 12, my project doesn't build for the simulator anymore.
The error I get is:
ld: in ... /Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector(
FIRAnalyticsConnector_e321ed8e3db06efc9803f6c008e67a34.o),
building for iOS Simulator, but linking in object file built for iOS, file
'.../Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector'
for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
A workaround is adding arm64
to my project > Build Settings > Excluded Architectures, but then it won't build for my real device.
I already tried cleaning the build folder, updating pod file, restarting etc.
I'm using:
Any ideas?
Ok, I finally found a fix for the issue.
Change "Build Active Architecture Only" to "Yes" also for "Release".
The setting can be found selecting your project > "Build Settings" > "Targets" (your target) > "Architectures"
Source and more elaborate explanation can be found here:
https://stackoverflow.com/a/64139830/4134160
Please note that the problem is not related to Firebase. I'll still leave it since it might lead others to this issue and help them to resolve this.
Apple Silicon
If you're running on an apple silicon chip, consider @Aspen's answer below: https://stackoverflow.com/a/65460729/4134160