After updating XCode recently, my project failed (it was running properly prior to the update). The error showed up on a line of code which imported a Firebase pod:
import FirebaseFirestoreSwift
and the error reads: "Module compiled with Swift 5.5.1 cannot be imported by Swift 5.6.1"
2
Answers
First thing to check, is if you are running XCode with an M1-based Mac. If so, make sure to do a pod update. For M1 this is different than just the simple "pod update" command, as follows:
sudo arch -x86_64 gem install ffi arch -x86_64 pod install
see reference: https://stackoverflow.com/a/70238542/11132995
Next, with XCode open, make sure it's selected such that you see "XCode" to the right of your 🍎 symbol on MacOS's menu up top, and then select the PRODUCT menu and click on 'Clean Build Folder'. see Figure One.
Let this run, and you should advance down the line for your errors. You may still encounter another firebase pods error, but that probably has to do with changing something in your podfile, like FirebaseFirestoreSwift may be a different version required such as '> 7.0-beta' or '8.1.0'. Check with Firebase.
(updated): More on Firebase Your project may run with a new error such as "FirebaseCore could not be found".
Run the command-- arch -x86_64 pod update on Terminal. You may see some Firebase pods updating to the latest builds-- see my example, ie), below. See FIGURE TWO for what it might look like when it's done. Your numbers will likely be higher, as time passes from the date of this post (July 2022)
ie) Installing BoringSSL -GRPC 0.0.24 (was 0.0.7) Installing Firebase 9.2.0 (was 8.10.0) Installing FirebaseFirestoreSwift 9.2.0 (was 8.10.0-beta) etc.... (this could be a long list of Firebase pods depending on your project, and it could take awhile, so don't run your project until it completes-- go get a Lebanon Bologna sandwich)
This update might even fix a few other errors in your project, related to your console prints (when running your project), if you're lucky and Google and Apple are on top of things.
(update 2): If things still not working, or more Firebase errors, try this solution: arch -x86_64 pod deintegrate arch -x86_64 pod install
'deintegrate' separates your project from the pod files (like Firebase SDKs). When you run pod install, the installer runs your Podfile again; thus, it INTEGRATES Firebase and your project again. Think of it like deleting the references to SDKs in your project (but it doesn't delete your pod files which are stored on your Mac). Deintegrate is like deleting a tether/link/call which sits in your project and directs your project to grab the Firebase files.
(if you've already run pod update, this should be quicker)
source: https://stackoverflow.com/a/70032985/11132995
update pod ‘FirebaseFirestoreSwift’, ‘9.2.0-beta’