Reputation: 14102
I want to add Firebase Cloud Messaging to my project which has already other services from Google (like Analytics). I am using cocoapods and I added to my podfile:
pod 'Firebase'
pod 'Firebase/Messaging'
I run pod install
and everything looked good but when I am trying to build project I get many duplicate symbol errors:
duplicate symbol _OBJC_CLASS_$_ACPGmpAudienceRoot in:
.../Pods/Google/Libraries/libGGLCore.a(GmpAudience.pb.o)
.../Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics(GmpAudience.pb_d68254ec585824fa42de6de2f056cda0.o)
... more and more duplicate symbol errors ...
How can I fix it? Why with Messaging there is added Analytics library too? I don't need it. I tried Clean project and delete Derived data but for now without luck.
Upvotes: 12
Views: 4304
Reputation: 15350
Update your Google/(Google analytics) pod version to 3.0 higher .
I was using version 2.0.4, I did pod update
and the following pods were update:
After that I was able to use Google analytics with Firebase
Upvotes: 4
Reputation: 94
I have exactly the same issue - an iOS app that is already using Google Analytics, but I want to add Firebase Messaging, just so the app can have a push notification capability. I added "pod 'Firebase/Messaging'" to the Podfile, and had the same linking errors on compiling.
A lot of searching revealed this compiler setting: Your Target -> Build Settings - Apple LLVM 7.1 - Code Generation -> No Common Blocks - set it to 'Yes', like this:
On Xcode 7.3 it seems the default for that setting is 'No', bu on making that change all the linking errors went away and the app built without issues.
Upvotes: 0
Reputation: 484
Depending on your use case, one thing you can consider: If you use Google Tag Manager, you can integrate with Firebase Analytics, and use GTM to forward the event data to Google Analytics if you prefer to have app and web data together or want to use Google Analytics for some other reason.
Upvotes: 0