Can't build to simulator on Apple Silicon

Using Xcode 12.2, the specific error is "building for iOS Simulator, but linking in object file built for iOS, file '.../FIRAnalyticsConnector' for architecture arm64".

I've seen reports of this as an Xcode 12/Cocoapods issue that my project didn't have with 12.1 or 12.0. It only popped up when trying to build on my new M1 MacBook Air and Xcode 12. I've tried everything that's been reported to fix it, no dice.

1) I've tried "pod install" & "pod update" with a Rosetta2 version of Terminal. Both complete without error, but Xcode still can't build.
2) I've set excluded architectures to "Arm64" on the project, target and pod project.
3) I've added x8664 and i386 to Architectures for project, target and pod project.
4) I've set all configurations to "Build Active Architecture Only" to Yes.
5) I've even created (and deleted) a "VALID
ARCHS" user defined setting with the proper architectures to all three projects.
6) I've cleaned build folder many times and deleted derived data folder completely, and restarted Xcode.

Still I get that same error. I can build to device, which I guess is my only choice at the moment. Anything else I can try?

Accepted Reply

The issue is with the Firebase/Analytics pod. The Firebase team has been notified and are working on a fix. Follow the issue here: https://github.com/firebase/firebase-ios-sdk/issues/6520

For the time being, you can remove the pod to continue development until the fix is released.
  • Over a year later, the issue persists. Surely this should have been sorted by now. Almost every developer worth their salt will be using M1 based machines at this point.

Add a Comment

Replies

Just got the new MBP with Apple Silicon. Having the same issue. Any updates?
The issue is with the Firebase/Analytics pod. The Firebase team has been notified and are working on a fix. Follow the issue here: https://github.com/firebase/firebase-ios-sdk/issues/6520

For the time being, you can remove the pod to continue development until the fix is released.
  • Over a year later, the issue persists. Surely this should have been sorted by now. Almost every developer worth their salt will be using M1 based machines at this point.

Add a Comment
You can run xcode in Rosetta
same just got the M1 MBP and having the same issue. Frustrating to wait for such a hyped product to find this, at least I'd to continue my original workflow, even if I can't get an enhanced version.
Having the same problem :( I have a few pods I rely on. :(
Same issue. My project which has Firebase dependencies runs fine on a physical device. To make it run in the simulator, I have to run Xcode with Rosetta 2.
What I don't quite grasp (maybe someone can enlighten me): the Simulator should run on the arm64 architecture on an M1 mac, right? So why do I have to exclude arm64 in my project for the iOS Simulator if I run it on an M1 mac? It makes sense if Xcode (and probably the simulator) run in Rosetta 2 and also if Xcode is running on an Intel Mac - because then the instructions for x86 are executed.
  • For some reason seperate binaries are need to fot the simulator, depending how the framework is packaged they can be called ios-arm64-simulator

Add a Comment
The issue has been resolved by Firebase. https://github.com/firebase/firebase-ios-sdk/issues/6520
This also seems to be an issue with the Spotify iOS SDK as well, it is expecting the Simulator to be running x86_64 but on my MacBook Air M1 the simulator is running ARM. It works okay on a device though.
Had the same issue. This has helped.
Hope it will help you too.
I'm facing the exact same problem, and already did the steps you've mentioned.. Do you have a solution to this problem? That's so annoying!
Thanks!
Running Xcode in Rosetta works.
Not only firebase got that issue GoogleMaps' framework too:

ld: building for iOS Simulator, but linking in object file built for iOS, file '.../ios/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/GoogleMaps' for architecture arm64

Note that building my App with Rosetta on Mbp M1 and xCode 12.4 do build, but shows a white screen.
Logging Failed to initialize client context with error and lot of others bad stuff ! :/




Post not yet marked as solved Up vote reply of crg Down vote reply of crg
Same problem:

Note that building my App with Rosetta on Macbook Air M1 and xCode 12.4 do build, but shows a white screen on emulator. 
In console this error:

Code Block 2021-02-05 00:34:23.204502+0100 myApp[31225:789860] [db] _LSSchemaConfigureForStore failed with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0x4b64f053 8d1364ff 0b68dbfb 9e7f437e ... d8889279 df4097f1 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x4b3fda1a 658aac51 e905a4b9 3f769913 ... 73e7d3c9 4a353cfc }}
2021-02-05 00:34:23.204588+0100 myApp[31225:789860] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0x4b64f053 8d1364ff 0b68dbfb 9e7f437e ... d8889279 df4097f1 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x4b3fda1a 658aac51 e905a4b9 3f769913 ... 73e7d3c9 4a353cfc }}
2021-02-05 00:34:23.205328+0100 myApp[31225:789860] [db] _LSSchemaConfigureForStore failed with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0x4b64f053 8d1364ff 0b68dbfb 9e7f437e ... d8889279 df4097f1 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x4b3fda1a 658aac51 e905a4b9 3f769913 ... 73e7d3c9 4a353cfc }}
2021-02-05 00:34:23.213108+0100 myApp[31225:789860] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0x4b64f053 8d1364ff 0b68dbfb 9e7f437e ... d8889279 df4097f1 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x4b3fda1a 658aac51 e905a4b9 3f769913 ... 73e7d3c9 4a353cfc }}
2021-02-05 00:34:23.213945+0100 myApp[31225:789860] [db] _LSSchemaConfigureForStore failed with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0x4b64f053 8d1364ff 0b68dbfb 9e7f437e ... d8889279 df4097f1 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x4b3fda1a 658aac51 e905a4b9 3f769913 ... 73e7d3c9 4a353cfc }}
2021-02-05 00:34:23.214031+0100 myApp[31225:789860] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0x4b64f053 8d1364ff 0b68dbfb 9e7f437e ... d8889279 df4097f1 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x4b3fda1a 658aac51 e905a4b9 3f769913 ... 73e7d3c9 4a353cfc }}
2021-02-05 00:34:23.215290+0100 myApp[31225:789860] [db] _LSSchemaConfigureForStore failed with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0x4b64f053 8d1364ff 0b68dbfb 9e7f437e ... d8889279 df4097f1 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x4b3fda1a 658aac51 e905a4b9 3f769913 ... 73e7d3c9 4a353cfc }}
2021-02-05 00:34:23.215391+0100 myApp[31225:789860] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0x4b64f053 8d1364ff 0b68dbfb 9e7f437e ... d8889279 df4097f1 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x4b3fda1a 658aac51 e905a4b9 3f769913 ... 73e7d3c9 4a353cfc }}


HI, might be this help to you please check this

https://github.com/firebase/firebase-ios-sdk/issues/7208#issuecomment-866845495

and let me know if it does not work.

Thanks.

The easiest way I found to solve this problem for Silicon Chip Macbooks.

  • Go into the project Build Settings
  • Set "Build Active Architecture Only" as "Yes" for both Debug and Release options
  • Clean the build folder (must)
  • Run your project in Xcode and it will work.