Xcode 9: %appName% 没有 %deviceName% 可以执行的架构

Xcode 9: %appName% does not have an architecture that %deviceName% can execute

我在 Xcode 9 中遇到过如下所列的此类错误:

%appName% does not have an architecture that %deviceName% can execute.

Target 'Pods-%appName%' of project 'Pods' was rejected as an implicit dependency for 'Pods_%appName%.framework' because its architectures 'armv7' didn't contain all required architectures 'arm64'

尽管如此,我有正确的项目设置:

  1. Valid Arhitectures 设置为 arm64 armv7 armv7s
  2. Build Active Architecture Only 仅在 Debug 模式下启用。

很长一段时间我都无法理解其中的原因。我走错了路,踩到了耙子。我在 SO 了解了所有关于 Xcode/Cocoapods 的问题,但没有得到答案。

如果遇到此类错误,解决方案如下所示。

architecture 读作 target,将 target 更改为适当的,如在设备上一样。