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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With