XCode 12, FIRAnalyticsConnector, Build Error

themenace picture themenace · Oct 2, 2020 · Viewed 8.1k times · Source

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:

  • Firebase/Analytics (6.33.0)
  • XCode 12.0.1 (12A7300)
  • COCOAPODS: 1.9.3

Any ideas?

Answer

themenace picture themenace · Oct 3, 2020

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"

Image of settings that need to be changed

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.