0

I wanted to try a new feature of Xcode 11 and build my iOS and iPad app, which uses some pods, on my Mac. enter image description here

But when I build the project, I always get error from one of the pods (in this project it is Realm):

building for Mac Catalyst, but linking in object file built for iOS Simulator, for architecture x86_64

Does anybody know how to correctly manage Podfile for project, which supports iOS, iPadOS and macOS? This is how my Podfile looks like.

project 'MyProject.xcodeproj'

target 'MyProject' do
   use_frameworks!

  # Pods for MyProject
   pod 'SnapKit', '~> 5.0.0'
   pod 'RealmSwift'
   pod 'Zip', '~> 1.1'
   pod 'Firebase/Core'
   pod 'Fabric', '~> 1.10.2'
   pod 'Crashlytics', '~> 3.13.4'
   pod 'Localize-Swift', '~> 2.0'

end

Thank you for your insights.

Ondřej Korol
  • 594
  • 6
  • 19

2 Answers2

1

It seems one of your pod files not supporting MacOS

what I tend to do is create different targets for MacOS, iOS, then creating a different #def for those different targets. For example:

def mainAppPods
  # Pods for main app
  pod 'Alamofire'
  ...
end

def extensionPods
  # Pods for Share Extension
  pod 'Gifu'
  ...
end


target 'ShareExtensionTest' do
  use_frameworks!
  extensionPods
end

target 'ShareExtensionLive' do
  use_frameworks!
  extensionPods
end


target 'Main App Live' do
  use_frameworks!
  mainAppPods
end


target 'Main App Test' do
  use_frameworks!
  mainAppPods

end
Canberk Ersoy
  • 428
  • 1
  • 5
  • 13
0

Your problem is the same in this case https://stackoverflow.com/a/57926682/4942403 , you need to chance pod 'Firebase/Core' to pod 'FirebaseCore'

Bortoli
  • 9
  • 3