Problem to build for the Mac Catalyst


(Jorge) #1

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)


(jay) #2

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?


#3

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


(Jorge) #4

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)