kacper99
kacper99

Reputation: 157

Firebase cocoapod problem "One of the two will be used. Which one is undefined"

I've got a problem when I install pods:
'Firebase/Analytics' 'Firebase/Auth' 'Firebase/Core' 'Firebase/Firestore'

When I launch the app I get a lot of classes with their localizations and sentences "Class is implemented in both. One of the two will be used. Which one is undefined"

I can't get solutions for days.

Upvotes: 2

Views: 543

Answers (2)

Jay
Jay

Reputation: 35669

The Firebase Documentation Add Firebase to an app is a great place to start!

You'll find info about setting up your podfile and to answer your question, this is mentioned

The Firebase iOS library Firebase/Core is no longer needed. This SDK included the Firebase SDK for Google Analytics

So your podfile would look like this

platform :ios, ‘12.0’

# Add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'

# Add the pods for any other Firebase products you want to use in your app
# For example, to use Firebase Authentication and Cloud Firestore
pod 'Firebase/Auth'
pod 'Firebase/Firestore'

to start creating your podfile, in the console, navigate to your project directory and do this

pod init

which will create a default podfile which you can add the Firebase pods to.

If you're having other pod issues, you may want to remove your current pods and re-do it. Start with

pod deintegrate

to remove any existing pods

Upvotes: 1

Paul Beusterien
Paul Beusterien

Reputation: 29582

FirebaseAnalytics is a static library and cannot be linked to multiple dynamic frameworks and the main app.

More details at https://github.com/firebase/firebase-ios-sdk/blob/master/docs/firebase_in_libraries.md.

Upvotes: 0

Related Questions