25

When trying to build for Mac using Catalyst, I get the following build error:

FIRAnalyticsConnector(FIRConnectorUtils_77ff1e12be6740765c87f1be0d421683.o), building for Mac Catalyst, but linking in object file built for iOS Simulator

The project builds fine for iOS andiPadOS.

RawMean
  • 7,547
  • 3
  • 52
  • 79

1 Answers1

14

The problem was related to the difference between Firebase/Core and FirebaseCore. The first is a subspec of the Firebase pod that depends on FirebaseAnalytics. The second is only the FirebaseCore pod. Only the latter should be used for macOS.

Solution: For Catalyst, set use FirebaseCore in the PodFile

Update: Here is the PodFile:

platform :ios, '11.0'

def reusepods
end

target 'BatteryCompare' do
    use_frameworks!

#    pod 'Firebase/Core'
    pod 'FirebaseCore'
    pod 'Firebase/Database'
    pod 'Firebase/Auth'

end
RawMean
  • 7,547
  • 3
  • 52
  • 79
  • 1
    Can you clarify how to resolve the issue? I don't see any Firebase/Core being used anywhere in my project. – kps2501 Sep 21 '19 at 23:33
  • Updated the answer to clarify. Please check the answer as accepted if it works for you. – RawMean Sep 22 '19 at 16:29
  • I'm already using Firebase/Core in my PodFile but am still getting the same error. – kps2501 Sep 22 '19 at 17:33
  • Make sure no other module in your PodFile is including FirebaseAnalytics. – RawMean Sep 22 '19 at 22:05
  • 2
    There was a typo in the solution which I corrected: Use ForbaseCore and not Firebase\Core – RawMean Oct 22 '19 at 23:33
  • This doesn't work for me either, could you share your PodFile? or at least which Firebase modules are you using? – Alejandro Cotilla Oct 24 '19 at 22:17
  • @AlejandroCotilla and guys. above solution is not working for me. pod file link https://drive.google.com/file/d/1ge3dBBwbLeqXJGg1ZgrEpZDULQ78FZoD/view I am facing same issues, I got a below error. /Users/ios/Desktop/xxxxxx/Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector(FIRConnectorUtils_d79571aba36a7d46e5c6ca87a6fec1c1.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, file '/Users/ios/Desktop/xxxxxx/Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector' for architecture x86_64 – Ankur Patel Jan 01 '20 at 11:38
  • Works like a charm ! Please note you need to 'pod deintegrate', 'pod clean' and 'pod install' after switching the pod. I had some duplicates errors. – Matt Jan 03 '20 at 08:03
  • @Matt there is no 'pod clean' command. What do you mean? – Daniel Wood Nov 19 '20 at 21:21
  • Sorry I didn't say it's a gem to install. It removes pods from project : https://link.medium.com/HfIsOxn1zbb – Matt Nov 20 '20 at 23:53