Closed mgrms closed 6 months ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Thanks for raising this, @mgrms. Adding -ObjC
linker option is listed on the requirements here, but I'll inform the team for this to be added as well on the docs.
@mgrms, I just noticed that this step is already on our documentation. Please see our installation guide for more info.
@rizafran
Thanks, now I see that page you mentioned indeed contains this step. But to be honest, I think it's still worth adding this step directly to Analytics installation page (https://firebase.google.com/docs/analytics/get-started?platform=ios#add-sdk), since it won't work without this step at all. Will be much clearer for people who use Firebase for the first time.
Reference to page you mentioned says: "Visit our installation guide to learn about the different ways you can add Firebase SDKs to your Apple project, including importing frameworks directly and using CocoaPods."
So I thought it's all about different ways of installing Firebase (CocoaPods, Carthage) which was not my case, and didn't even look there.
I will close this now. Thanks for your help!
I'll reopen, since I agree that we should add to the Analytics installation page.
@paulb777 I don't believe the ObjC flag is required anymore? Asking as it causes conflicts with 3rd parties that statically embed Firebase (which is also wrong so it's good to catch). But I think this issue is no longer an issue so are there plans to remove it from documentation or is it still required?
@joshuapoq It's now less required.
If the app uses an API from FirebaseAnalytics, it will be fully linked without the use of the -ObjC
option.
If FirebaseAnalytics is used without any of its APIs, then -ObjC
is still needed.
The docs have been updated.
Description
Firebase Analytics SPM integration docs does not contain step about adding "-ObjC" to "Other Linker Flags". CocoaPods do that automatically, but with SPM you need to do that manually, or Firebase Analytics won't work at all.
Just spent a few hours to find this problem.
I think it will be nice to update the docs. (https://firebase.google.com/docs/analytics/get-started?platform=ios#add-sdk)
Reproducing the issue
Create new project, integrate FirebaseAnalytics into UIKit project via SPM.
Firebase SDK Version
10.3.0
Xcode Version
14.2
Installation Method
Swift Package Manager
Firebase Product(s)
Analytics
Targeted Platforms
iOS
Relevant Log Output
No response
If using Swift Package Manager, the project's Package.resolved
No response
If using CocoaPods, the project's Podfile.lock
No response