Code Block ld: in /Applications/Xcode-beta3.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator7.0.sdk/usr/lib/libWKExtensionMainLegacy.a(WKExtensionMainLegacy.o), building for watchOS Simulator, but linking in object file (/Applications/Xcode-beta3.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator7.0.sdk/usr/lib/libWKExtensionMainLegacy.a(WKExtensionMainLegacy.o)) built for watchOS, for architecture arm64
From what I understand is that it is complaining that the libWKExtensionMainLegacy.a file is build for arm64, not the simulator.
I've checked https://developer.apple.com/forums/thread/130684 but didn't really help me.
Any suggestions on how to resolve this?
I have CLANG_MODULES_AUTOLINK set to NO, both WatchConnectivity and WatchKit frameworks linked explicitly (the extension is written in Objective-C).
Turned out libWKExtensionMainLegacy.a in Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator7.0.sdk supports x86_64, i386, and arm64.
Code Block $ lipo -archs libWKExtensionMainLegacy.a x86_64 arm64 i386
However, according to the link https://developer.apple.com/forums/thread/130684, the configuration might not be correct.
Stripping the arm64 from the binary didn't help (just did it for testing, it couldn't be treated as a solution anyway), and got a new warning:Having x8664 code is not sufficient to distinguish if a binary is intended for the iOS Simulator, a macOS app, or a Mac Catalyst app. Combing built binaries across different destinations (which includes the simulator vs. device binaries) is not a supported combination -- there is no Apple platform where ARM code and x8664 code in the same binary is a correct configuration.
Code Block Showing Recent Issues Ignoring file .../Xcode12-beta3.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator7.0.sdk/usr/lib/libWKExtensionMainLegacy.a, missing required architecture arm64 in file .../Xcode12-beta3.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator7.0.sdk/usr/lib/libWKExtensionMainLegacy.a (2 slices)
and error:
Code Block Showing Recent Issues In .../Xcode12-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.watchos.a(floatditf.c.o), building for watchOS Simulator, but linking in object file (.../Xcode12-beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.watchos.a(floatditf.c.o)) built for watchOS, file '.../Xcode12-beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.watchos.a' for architecture arm64