'Firebase Analytics Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_FIRAnalytics"

After updating Firebase to 7.6.0 via cocoapods I get the following link error, but only when targeting the simulator. Everything builds fine when targeting a device.

  "_OBJC_CLASS_$_FIRAnalytics", referenced from:
      objc-class-ref in MainTabBarController.o
ld: symbol(s) not found for architecture x86_64

I have tried just about everything that stack overflow recommends for this error without any luck. I have searched throughout the project for any reference to x86_64 vs arm to try and understand why one will link and the other wont. Any help would be appreciated.



Solution 1:[1]

You might need to set this as a static library in your pod file

post_install do |installer|
installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        if  target.name == 'FirebaseAnalytics'
            config.build_settings['MACH_O_TYPE'] = 'staticlib'
        end
    end
end 
end

Solution 2:[2]

I was using @awesome-cordova-plugins/firebase-analytics in a Capacitor app and when I upgraded from version 2 to 3 of Capacitor I started to get this error about OBJC_CLASS$_FIRAnalytics. I spent over half the day trying everything out there including the stuff here. Nothing worked and so I finally gave up and went for a different plugin. I switched over to @capacitor-community/firebase-analytics and it eliminated the problem.

I don't think I had to change anything on the iOS side, but I had to make some minor changes to the js in my typescript files.

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 Musadhikh Muhammed K
Solution 2 FinestStudios