Problem to build for the Mac Catalyst

Im trying to build my application to Mac. But when build happen it:
ld: in /Users/myuser/project / Pods / Realm / core / librealmcore-ios.a (bptree.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

are you sure that’s the exact error message?

Can you clarify what you’re asking and what troubleshooting steps you’ve done? OS Version? RealmSwift version? Does the project build then crash or doesn’t build at all?

Same issue for me:

ld: in /Users/alexandre/Developer/MyApp/Pods/Realm/core/librealmcore-ios.a(bptree.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Steps to reproduce:

  • Create a new Xcode project
  • Init pods
  • Add Realm with this two lines: (same issue with pod 'RealmSwift' by the way)
pod 'Realm', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', submodules: true
pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', submodules: true
  • Install pods
  • Check macOS checkbox to enable Catalyst
  • Try to build the project

OS Version:
macOS Catalina

Xcode version:
Xcode 11

The project doesn’t build at all.

If I get Realm by Swift Package Manager, it works fine, but I don’t want to use SPM for Realm and Pods for all of my others dependencies…

Thanks,

Alexandre

Ld /Users/jflor/Library/Developer/Xcode/DerivedData/SaleSphere-bjfujjffmxaoawbgwdxpkdsasbxx/Build/Products/Debug-maccatalyst/Realm/Realm.framework/Versions/A/Realm normal x86_64 (in target ‘Realm’ from project ‘Pods’)
cd /Users/jflor/Sites/mvise/dev/salesphere-ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-ios13.0-macabi -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -L/Users/jflor/Library/Developer/Xcode/DerivedData/SaleSphere-bjfujjffmxaoawbgwdxpkdsasbxx/Build/Products/Debug-maccatalyst/Realm -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/usr/lib -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/maccatalyst -L/Users/jflor/Sites/mvise/dev/salesphere-ios/Pods/Realm/core -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/usr/lib -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/maccatalyst -F/Users/jflor/Library/Developer/Xcode/DerivedData/SaleSphere-bjfujjffmxaoawbgwdxpkdsasbxx/Build/Products/Debug-maccatalyst/Realm -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/System/Library/Frameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/System/Library/Frameworks -filelist /Users/jflor/Library/Developer/Xcode/DerivedData/SaleSphere-bjfujjffmxaoawbgwdxpkdsasbxx/Build/Intermediates.noindex/Pods.build/Debug-maccatalyst/Realm.build/Objects-normal/x86_64/Realm.LinkFileList -install_name @rpath/Realm.framework/Versions/A/Realm -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -object_path_lto -Xlinker /Users/jflor/Library/Developer/Xcode/DerivedData/SaleSphere-bjfujjffmxaoawbgwdxpkdsasbxx/Build/Intermediates.noindex/Pods.build/Debug-maccatalyst/Realm.build/Objects-normal/x86_64/Realm_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -fapplication-extension -lc++ -lrealmcore-ios -lz -framework Security -framework Foundation -framework Security -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/jflor/Library/Developer/Xcode/DerivedData/SaleSphere-bjfujjffmxaoawbgwdxpkdsasbxx/Build/Intermediates.noindex/Pods.build/Debug-maccatalyst/Realm.build/Objects-normal/x86_64/Realm_dependency_info.dat -o /Users/jflor/Library/Developer/Xcode/DerivedData/SaleSphere-bjfujjffmxaoawbgwdxpkdsasbxx/Build/Products/Debug-maccatalyst/Realm/Realm.framework/Versions/A/Realm

ld: in /Users/jflor/Sites/mvise/dev/salesphere-ios/Pods/Realm/core/librealmcore-ios.a(bptree.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any news regarding this issue?

I tried to build Realm and embedded directly, and I get the following error:

/xxx.xcodeproj Building for Mac Catalyst, but the linked and embedded framework ‘Realm.framework’ was built for iOS + iOS Simulator. You may need to restrict the platforms for which this framework should be linked and embedded in the target editor, or replace it with an XCFramework that supports both platforms.

I’m using Cocoapods for other dependencies and I can use them with no problems.

Make sure that the first line in your podfile contains the following:

platform :osx, '10.10'

You are probably specifying platform :iOS rather osx.

I’ve managed to build for macOS (Catalyst) using Swift Package Manager.
You can check the working project in https://github.com/ruuvi/com.ruuvi.station.ios/tree/dev.
NB: dev branch, not master.

Is there anything new please? I have iOS app, which uses Pods like this:

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

And when I check checkbox for MacOS in Xcode - I can’t build my project because of this error:

n /Users/Me/Documents/XcodeProjects/MyProject/Pods/Realm/core/librealmcore-ios.a(bptree.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, for architecture x86_64

What should I do please? I don’t want to change pods to Swift Package Manager.

I am also facing this problem when I build my application to Mac. Linker command gets not failed with exit code but id problem with me also. I am working at a Professional SEO services agency as aa executive SEO so plz help me how I can solve this problem?