Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FIRAnalyticsConnector: building for Mac Catalyst, but linking in object file built for iOS Simulator

Tags:

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.

like image 554
RawMean Avatar asked Aug 26 '19 23:08

RawMean


People also ask

Is IOS simulator arm64?

Both ios-arm64-simulator and ios-x86_64-simulator represent two equivalent library definitions. Seeing these when trying to create an xcframework for Apple Silicon that supports Mac Catalyst and the iOS Simulator: Both ios-arm64-simulator and ios-x86_64-simulator represent two equivalent library definitions.

How do I add excluded architecture in Xcode?

Go to Targets section, select each target and do the following: Set Build Active Architecture Only to YES. Add Excluded Architectures and set its value to arm64 (See attached) Set Active scheme (on toolbar next to project name) to any iOS Simulator.

Is missing one or more architectures required by this target x86_64?

framework' is missing one or more architectures required by this target: x86_64. This can happen when switching between simulator versions on a Cocoapods project. Cleaning the project should fix the issue. This error occurs when a arm64 iPhoneSimulator slice cannot be found for one of your binary dependencies.


1 Answers

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 
like image 185
RawMean Avatar answered Oct 22 '22 22:10

RawMean