【发布时间】:2021-10-31 12:59:07
【问题描述】:
我有一台 M1 MacBook Air。
在 Xcode 中为模拟器构建时,我看到以下警告和错误:
ld: warning: ignoring file /Users/kon/Library/Developer/Xcode/DerivedData/InvisibleComputersApp-hktlnhvaoskvxkcdhnahydmbodzw/Build/Products/Debug-iphonesimulator/GoogleSignIn.o, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/kon/Library/Developer/Xcode/DerivedData/InvisibleComputersApp-hktlnhvaoskvxkcdhnahydmbodzw/Build/Products/Debug-iphonesimulator/AppAuth.o, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file
/Users/kon/Library/Developer/Xcode/DerivedData/InvisibleComputersApp-hktlnhvaoskvxkcdhnahydmbodzw/Build/Products/Debug-iphonesimulator/GTMAppAuth.o, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/kon/Library/Developer/Xcode/DerivedData/InvisibleComputersApp-hktlnhvaoskvxkcdhnahydmbodzw/Build/Products/Debug-iphonesimulator/AppAuthCore.o, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/kon/Library/Developer/Xcode/DerivedData/InvisibleComputersApp-hktlnhvaoskvxkcdhnahydmbodzw/Build/Products/Debug-iphonesimulator/GTMSessionFetcherCore.o, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-arm64
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GIDConfiguration", referenced from:
objc-class-ref in GlobalState.o
"_OBJC_CLASS_$_GIDSignIn", referenced from:
objc-class-ref in GoogleAuthService.o
objc-class-ref in GoogleRefreshTokenService.o
objc-class-ref in InvisibleComputersAppApp.o
"_OBJC_CLASS_$_GIDSignInButton", referenced from:
objc-class-ref in LoginView.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
这听起来像是 Xcode 试图构建一个 x86 二进制文件?为什么它甚至试图这样做,不是基于 M1 Macs 的模拟器 arm 吗?
我该怎么做
【问题讨论】:
-
检查项目设置和 .xcconfig 文件 - 可能有 x86_64 架构集。
-
@Asperi 这会是什么样子?
-
在“架构”下显示“标准架构 (arm64, armv7) - $(ARCHIS STANDARD)
-
嘿@Asperi - 是的,我找到了一个设置。由于其他一些问题,我之前一直在关注堆栈溢出答案以禁用模拟器的 ARM 构建......现在切换到 M1 Mac 后,这让我很痛苦。
-
得到了同样的结果。你发现了吗?