切换到xcode 14后,构建系统。为我们的pod框架生成的头看起来如下所示:
#if 0
#elif defined(__arm64__) && __arm64__
// Generated by Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)
... bridging for arm64
#else
#error unsupported Swift architecture
#endif
#if 0
#elif defined(__x86_64__) && __x86_64__
// Generated by Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)
... bridging for x86
#else
#error unsupported Swift architecture
#endif如果我查看标题,就会看到这样的场景:
arm64定义和x86定义(应该是OK、arm64定义和x86不定义)应该是错误arm64,而x86应该是错误,因此为了避免错误,应该定义两种体系结构。这导致客户端应用程序构建失败并出现错误:错误不支持Swift体系结构。
即使ONLY_ACTIVE_ARCH = 0,这也可能是修补程序。我还是会犯这个错误。
有谁知道为什么预编译头现在需要这两种架构。以及如何修复构建错误?
发布于 2022-11-29 07:44:57
如果您的Mac芯片是M2或M1,您可以尝试使用XCode的Rosetta模式进行编译。
https://stackoverflow.com/questions/74517344
复制相似问题