1

Just removed Crashlytics from the podfile, then added it as a Swift Package. Built for an actual device just fine. But when I switch to the Simulator, no go (and tried deleting Derived folders etc - no change).

Another dev using Xcode 13.2.1 on an Intel Mac can build for the Simulator just fine.

Doesn't matter if I delete DerivedFolder then build first for Simulaor or for device - when I get to Simulator it always fails same errors.

The Excluded Architectures for everything are arm64, Build Active Architure=YES

Xcode 13.4.1
Mac: Monterey 13.4

ld: warning: ignoring file .../Build/Products/Debugging-iphonesimulator/FirebaseCrashlytics.o, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-arm64
... (12 others)
ld: warning: ignoring file .../Build/Products/Debugging-iphonesimulator/FirebaseInstallations.o, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-arm64
Undefined symbols for architecture x86_64:
    "_OBJC_CLASS_$_FIRCrashlytics", referenced from:
      objc-class-ref in <SomeFile>-8e51ce451b9a03f7582a9e76a8faf6a6.o
      objc-class-ref in <SomeFile>-e71967da3e8b662633c9220e635ffc51.o
    "_OBJC_CLASS_$_FIRApp", referenced from:
     objc-class-ref in SSLog-8e51ce451b9a03f7582a9e76a8faf6a6.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
David H
  • 40,852
  • 12
  • 92
  • 138
  • The pitfalls of early adoption. You may have better luck posting this as an issue on the Firebase GitHub if you haven’t already. – trndjc Sep 15 '22 at 21:43
  • @fakegirlfriends early adoption? FB stopped issuing pod updates a year plus ago. Packages have been around for years. But yeah should go to the FB site. Geez. – David H Sep 16 '22 at 02:00
  • I meant M1 with Simulator. And Firebase hasn't stopped supporting CocoaPods; `pod update` will get you the current Firebase version. Firebase recommends SPM after v8 but CocoaPods are still good. – trndjc Sep 16 '22 at 02:38
  • @fakegirlfriends I'm not sure what the CocoaPods issue is, but doing `pod update` does not get me past release 8.xomething. Perhaps I need to direct the Podfile to use the GitHub site not the CocoaPods repository. In any case, SWP is a better long term solution due to direct linking of the code. – David H Sep 16 '22 at 15:13
  • 1
    Posted directly to Firebase `Issues` on GitHub, will update here of a solution (if there is one). – David H Sep 16 '22 at 18:48

2 Answers2

1

I posted to Firebase Issues but this issue didn't ring a bell. However, I did trip on an Apple TN on M1 Mac build issues, and doing what they suggested revolved the issue.

It appears that when Xcode builds Packages the rules it follows may not use the target's build settings. I believe the issue was related to Excluded Architectures.

David H
  • 40,852
  • 12
  • 92
  • 138
0

For me the issue was fixed by making sure Xcode was running in Rosetta mode.

skeg0
  • 95
  • 2
  • 10
  • That would be a real hardship. I mean performance goes way down. But yeah, if nothing else works then slow better than not running. That said latest Xcode working pretty well. – David H Feb 16 '23 at 23:01