You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xcode编译报错No architectures to compile for,请求排查问题原因

Fixing "No architectures to compile for (ARCHS=arm64, VALID_ARCHS=armv6 armv7)" Error

Hey there, let's break down and fix this architecture mismatch issue you're facing!

What's causing the error?

The problem is straightforward: your project is set to compile for the arm64 architecture (configured in ARCHS), but your VALID_ARCHS list only includes armv6 and armv7. Since there's no overlap between these two sets, the compiler can't figure out which architecture to build for—hence the frustrating error.

Step-by-step fixes

Here are a few actionable ways to resolve this, depending on your project's needs:

  • Add arm64 to VALID_ARCHS

    1. Open your Xcode project, select your target, and switch to the Build Settings tab.
    2. Search for VALID_ARCHS (you may need to toggle from "Basic" to "All" settings to see it).
    3. Update the value to include arm64, making it: armv6 armv7 arm64.
    4. Confirm your ARCHS setting still includes arm64 (it already does in your case) so the two lists have overlapping architectures.
  • Simplify VALID_ARCHS for modern projects
    If you don't need to support extremely old devices (armv6 is practically obsolete now), you can:

    1. Set VALID_ARCHS to armv7 arm64.
    2. Ensure ARCHS is set to a compatible option like Standard architectures (armv7, arm64) or just arm64 if you only target newer iOS devices.
  • Remove VALID_ARCHS entirely (recommended for newer Xcode versions)
    Recent Xcode versions handle valid architectures automatically based on your ARCHS setting and target iOS version. You can:

    1. Select the VALID_ARCHS row in Build Settings.
    2. Press the delete key to remove the setting entirely.
    3. Clean your project (press Cmd + Shift + K) and rebuild—this also clears any stale build cache that might cause issues.

Extra tips

  • If you're using CocoaPods, double-check that your Pods targets have matching architecture settings. You might need to run pod install again after updating your project's config.
  • After making changes, it's a good idea to delete your derived data (Xcode > Settings > Locations > Derived Data > Delete) to avoid any lingering build artifacts causing unexpected problems.

内容的提问来源于stack exchange,提问作者user979331

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:08:13