Reputation: 460
I just followed the iOS firebase guide for setting up crashlytics and analytics and whenever I try to use the analytics functions, they aren't being recognized.
The IDE throws this error Type 'Analytics' has no member 'logEvent'
whenever I try to use the following function
Analytics.logEvent(AnalyticsEventSelectContent, parameters: [
AnalyticsParameterItemID: "id-\(title!)",
AnalyticsParameterItemName: title!,
AnalyticsParameterContentType: "cont"
])
I've even tried importing all the following at the top of the file and the same thing occurs.
import FirebaseAnalytics
import Firebase
import FirebaseCore
import FirebaseCrashlytics
import FirebaseInstallations
These are the Firebase libraries that get added when I run pod install
Installing Firebase (6.33.0)
Installing FirebaseAnalytics (6.8.3)
Installing FirebaseCore (6.10.3)
Installing FirebaseCoreDiagnostics (1.7.0)
Installing FirebaseCrashlytics (4.6.1)
Installing FirebaseInstallations (1.7.0)
And these are the ones I specify in the podfile
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
Upvotes: 0
Views: 600
Reputation: 460
...apparently our project had an enum namespace named 'Analytics' that was overriding the library. This was confirmed when I called the function with Firebase.Analytics.logEvent()
:(
Upvotes: 3