skip to Main Content

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

3

Answers


  1. Upgrade firebase_analytics to latest version
    flutter clean
    remove Podfile.lock
    pod update
    flutter run
    
    Login or Signup to reply.
  2. 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}];
    
    Login or Signup to reply.
  3. I was facing the same issue in RNFirebaseAnalytics.m file, update the following line of code:

    [FIRAnalytics setScreenName:screenName screenClass:screenClassOverriew];

    to :-

    [FIRAnalytics logEventWithName :kFIREventScreenView parameters: @{kFIREventScreenView: screenName}];

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search