I’m using the Firebase and the SDWebImageSwiftUI module in my SwiftUI 2 app with Xcode 12.3 and Cocoapod 1.10.0 on my Apple M1 MacBook Pro.
As long as I don’t integrate the Firebase Analytics module via Cocoapod the app works fine but when I integrate it, I get the same error as the guy here: Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64. His solution also works for me (exclude arm64 architecture for the project and pods).
However now the SDWebImageSwiftUI module (included via swift package manager) is complaining "Could not find module ‘SDWebImageSwiftUI’ for target ‘x86_64-apple-ios-simulator’; found: arm64, arm64-apple-ios-simulator". If I include the module via Cocoapod then the compiler says "No such module "SDWebImageSwiftUI".
Does anyone of you has an idea on what I could do?
Any help is much appreciated
5
Answers
Edit March 2023 – Since Firebase 7.5.0, Firebase supports the M1 processor by default. No special instructions are needed.
When specifying which version of Firebase you’d like in your Podfile, append -M1 to the version. See the following examples:
Do the same for any other Firebase pod used.
Remember: now you need to manually add -ObjC to avoid a runtime crash. This CocoaPods issue has been fixed in CocoaPods/CocoaPods#10234 and is merged for the upcoming CocoaPods 1.10.1 patch release.
Checking the option "Open with Rosetta" (as in the screenshot below) helped me to solve this problem. After the error disappears, you can switch back and open Xcode without Rosetta.
You no longer need to append M1 according to the updates from Firebase. You may check it on the link for further instructions.
https://github.com/firebase/firebase-ios-sdk/blob/master/AppleSilicon.md
Try this:
In your root
sudo arch -x86_64 gem install ffi
cd to your project folder and
arch -x86_64 pod install
Please take a look at this. https://stackoverflow.com/a/68037246/4862289
Go to Application folder -> Right click on Terminal App -> Get Info
Tick Open with Rosetta option.
try
pod install
now.