'error: no known class method for selector 'setScreenName:screenClass:'
Hi im trying to build my app for flutter and the compiler returns back an error:
Command MergeSwiftModule failed with a nonzero exit code
/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics-7.1.1/ios/Classes/FLTFirebaseAnalyticsPlugin.m:49:19: error: no known class method for selector 'setScreenName:screenClass:'
[FIRAnalytics setScreenName:screenName screenClass:screenClassOverride];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have tried to google as much as i can but i dont know why else it is not working my flutter is in the latest version on channel stable: 2.2.3
I have tried -flutter clean -pod update -pod install --repo-update -pod install -sudo gem install cocoapods
Please help out i will try to supply any other information required. Thank you
Solution 1:[1]
If same error is occurring in react-native then in RNFirebaseAnalytics.m file, update following line of code:
[FIRAnalytics setScreenName:screenName screenClass:screenClassOverriew];
to
[FIRAnalytics logEventWithName:kFIREventScreenView parameters: @{kFIRParameterScreenName: screenName}];
Solution 2:[2]
Upgrade firebase_analytics to latest version
flutter clean
remove Podfile.lock
pod update
flutter run
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | ziqq |
