Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - Duplicate symbols when added Firebase Messaging (conflict with Google Analytics)

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.

like image 478
Libor Zapletal Avatar asked Jun 14 '16 09:06

Libor Zapletal


1 Answers

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:

  • Installing Google 3.0.3 (was 2.0.4)
  • Installing GoogleSignIn 4.0.0 (was 3.0.0)

After that I was able to use Google analytics with Firebase

like image 56
Guilherme Torres Castro Avatar answered Oct 20 '22 01:10

Guilherme Torres Castro